]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
Merge pull request #36007 from votdev/issue_46448_hosts_unit_tests
authorTatjana Dehler <tdehler@suse.com>
Wed, 29 Jul 2020 11:33:14 +0000 (13:33 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Jul 2020 11:33:14 +0000 (13:33 +0200)
mgr/dashboard: Add hosts page unit tests

Reviewed-by: Sebastian Krah <skrah@suse.com>
Reviewed-by: Tatjana Dehler <tdehler@suse.com>
Reviewed-by: Tiago Melo <tmelo@suse.com>
1  2 
src/pybind/mgr/dashboard/frontend/src/app/ceph/cluster/hosts/hosts.component.spec.ts

index bd6444d726edd040ceced5d32d06f633d514ba86,c8f395db5fc41fed3076fe546b4df9018e0b60e4..eb8ad20b03535e1da3f65751de6219213d8c9ab7
@@@ -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,