]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph-ci.git/blob
1bce83fcc5a6f0c2225e5ec75ff0e85d9a97bf2c
[ceph-ci.git] /
1 import { ComponentFixture, TestBed } from '@angular/core/testing';
2
3 import { RgwSyncPrimaryZoneComponent } from './rgw-sync-primary-zone.component';
4 import { configureTestBed } from '~/testing/unit-test-helper';
5 import { By } from '@angular/platform-browser';
6
7 describe('RgwSyncPrimaryZoneComponent', () => {
8   let component: RgwSyncPrimaryZoneComponent;
9   let fixture: ComponentFixture<RgwSyncPrimaryZoneComponent>;
10
11   configureTestBed({
12     declarations: [RgwSyncPrimaryZoneComponent]
13   });
14
15   beforeEach(() => {
16     fixture = TestBed.createComponent(RgwSyncPrimaryZoneComponent);
17     component = fixture.componentInstance;
18     fixture.detectChanges();
19   });
20
21   it('should create', () => {
22     expect(component).toBeTruthy();
23   });
24
25   it('should display realm, zonegroup, and zone in badges', () => {
26     component.realm = 'Realm';
27     component.zonegroup = 'Zonegroup';
28     component.zone = 'Zone';
29     fixture.detectChanges();
30
31     const realmBadge = fixture.debugElement.query(By.css('li:nth-child(2)'));
32     expect(realmBadge.nativeElement.textContent).toContain('Realm');
33
34     const zonegroupBadge = fixture.debugElement.query(By.css('p'));
35     expect(zonegroupBadge.nativeElement.textContent).toContain('Zonegroup');
36
37     const zoneBadge = fixture.debugElement.query(By.css('li:nth-child(8)'));
38     expect(zoneBadge.nativeElement.textContent).toContain('Zone');
39   });
40 });