1 import { ComponentFixture, TestBed } from '@angular/core/testing';
3 import { RgwSyncPrimaryZoneComponent } from './rgw-sync-primary-zone.component';
4 import { configureTestBed } from '~/testing/unit-test-helper';
5 import { By } from '@angular/platform-browser';
7 describe('RgwSyncPrimaryZoneComponent', () => {
8 let component: RgwSyncPrimaryZoneComponent;
9 let fixture: ComponentFixture<RgwSyncPrimaryZoneComponent>;
12 declarations: [RgwSyncPrimaryZoneComponent]
16 fixture = TestBed.createComponent(RgwSyncPrimaryZoneComponent);
17 component = fixture.componentInstance;
18 fixture.detectChanges();
21 it('should create', () => {
22 expect(component).toBeTruthy();
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();
31 const realmBadge = fixture.debugElement.query(By.css('li:nth-child(2)'));
32 expect(realmBadge.nativeElement.textContent).toContain('Realm');
34 const zonegroupBadge = fixture.debugElement.query(By.css('p'));
35 expect(zonegroupBadge.nativeElement.textContent).toContain('Zonegroup');
37 const zoneBadge = fixture.debugElement.query(By.css('li:nth-child(8)'));
38 expect(zoneBadge.nativeElement.textContent).toContain('Zone');