diff options
Diffstat (limited to '')
-rw-r--r-- | src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.spec.ts | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.spec.ts b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.spec.ts new file mode 100644 index 000000000..be65424cf --- /dev/null +++ b/src/pybind/mgr/dashboard/frontend/src/app/ceph/rgw/rgw-multisite-details/rgw-multisite-details.component.spec.ts @@ -0,0 +1,43 @@ +import { HttpClientTestingModule } from '@angular/common/http/testing'; +import { DebugElement } from '@angular/core'; +import { ComponentFixture, TestBed } from '@angular/core/testing'; +import { TreeModule } from '@circlon/angular-tree-component'; +import { ToastrModule } from 'ngx-toastr'; +import { SharedModule } from '~/app/shared/shared.module'; + +import { RgwMultisiteDetailsComponent } from './rgw-multisite-details.component'; +import { RouterTestingModule } from '@angular/router/testing'; +import { configureTestBed } from '~/testing/unit-test-helper'; + +describe('RgwMultisiteDetailsComponent', () => { + let component: RgwMultisiteDetailsComponent; + let fixture: ComponentFixture<RgwMultisiteDetailsComponent>; + let debugElement: DebugElement; + + configureTestBed({ + declarations: [RgwMultisiteDetailsComponent], + imports: [ + HttpClientTestingModule, + TreeModule, + SharedModule, + ToastrModule.forRoot(), + RouterTestingModule + ] + }); + + beforeEach(() => { + fixture = TestBed.createComponent(RgwMultisiteDetailsComponent); + component = fixture.componentInstance; + debugElement = fixture.debugElement; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); + + it('should display right title', () => { + const span = debugElement.nativeElement.querySelector('.card-header'); + expect(span.textContent).toBe('Topology Viewer'); + }); +}); |