From: Tatjana Dehler Date: Wed, 29 Jul 2020 11:33:14 +0000 (+0200) Subject: Merge pull request #36007 from votdev/issue_46448_hosts_unit_tests X-Git-Tag: wip-pdonnell-testing-20200918.022351~533 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=0dc5c8b28840edc9ecd11cb7d0d2b4a4c14f2088;p=ceph-ci.git Merge pull request #36007 from votdev/issue_46448_hosts_unit_tests mgr/dashboard: Add hosts page unit tests Reviewed-by: Sebastian Krah Reviewed-by: Tatjana Dehler Reviewed-by: Tiago Melo --- 0dc5c8b28840edc9ecd11cb7d0d2b4a4c14f2088 diff --cc src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts index bd6444d726e,c8f395db5fc..eb8ad20b035 --- a/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts @@@ -6,9 -7,11 +7,11 @@@ import * as _ from 'lodash' import { ToastrModule } from 'ngx-toastr'; import { of } from 'rxjs'; -import { configureTestBed, i18nProviders } from '../../../../testing/unit-test-helper'; +import { configureTestBed } from '../../../../testing/unit-test-helper'; import { CoreModule } from '../../../core/core.module'; import { HostService } from '../../../shared/api/host.service'; + import { ActionLabels } from '../../../shared/constants/app.constants'; + import { CdTableAction } from '../../../shared/models/cd-table-action'; import { Permissions } from '../../../shared/models/permissions'; import { AuthStorageService } from '../../../shared/services/auth-storage.service'; import { SharedModule } from '../../../shared/shared.module'; @@@ -86,10 -90,16 +89,16 @@@ describe('HostsComponent', () => ); expect(spans[0].textContent).toBe(hostname); }); - })); + }); - describe('getEditDisableDesc', () => { - it('should return message (not managed by Orchestrator)', () => { + describe('test edit button', () => { + let tableAction: CdTableAction; + + beforeEach(() => { + tableAction = _.find(component.tableActions, { name: ActionLabels.EDIT }); + }); + + it('should disable button and return message (not managed by Orchestrator)', () => { component.selection.add({ sources: { ceph: true,