]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/blob
a2fd6c6f3314464505dca10b78f6335f794819b2
[ceph-ci.git] /
1 import { HttpClientTestingModule } from '@angular/common/http/testing';
2 import { DebugElement } from '@angular/core';
3 import { ComponentFixture, TestBed } from '@angular/core/testing';
4 import { TreeModule } from '@circlon/angular-tree-component';
5 import { ToastrModule } from 'ngx-toastr';
6 import { SharedModule } from '~/app/shared/shared.module';
7
8 import { RgwMultisiteDetailsComponent } from './rgw-multisite-details.component';
9 import { RouterTestingModule } from '@angular/router/testing';
10
11 describe('RgwMultisiteDetailsComponent', () => {
12   let component: RgwMultisiteDetailsComponent;
13   let fixture: ComponentFixture<RgwMultisiteDetailsComponent>;
14   let debugElement: DebugElement;
15
16   beforeEach(async () => {
17     await TestBed.configureTestingModule({
18       declarations: [RgwMultisiteDetailsComponent],
19       imports: [
20         HttpClientTestingModule,
21         TreeModule,
22         SharedModule,
23         ToastrModule.forRoot(),
24         RouterTestingModule
25       ]
26     }).compileComponents();
27   });
28
29   beforeEach(() => {
30     fixture = TestBed.createComponent(RgwMultisiteDetailsComponent);
31     component = fixture.componentInstance;
32     debugElement = fixture.debugElement;
33     fixture.detectChanges();
34   });
35
36   it('should create', () => {
37     expect(component).toBeTruthy();
38   });
39
40   it('should display right title', () => {
41     const span = debugElement.nativeElement.querySelector('.card-header');
42     expect(span.textContent).toBe('Topology Viewer');
43   });
44 });