Skip to content

Commit 99ac829

Browse files
committed
test(showcase): add showcase test
1 parent 83bc52f commit 99ac829

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

projects/pretty-html-log-showcase/src/app/got-families/got-families.component.spec.ts

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,8 @@ describe('GotFamiliesComponent', () => {
7373

7474
targaryenTab.nativeElement.click();
7575

76-
/*
7776
fixture.detectChanges();
77+
/*
7878
await fixture.whenStable();
7979
*/
8080

@@ -86,4 +86,27 @@ describe('GotFamiliesComponent', () => {
8686
);
8787
expect(actualFamilieMembers).toEqual(targaryens);
8888
});
89+
90+
it(`should display the Targaryen family once we click on the Targaryen tab`, async () => {
91+
const targaryens = [
92+
'Daenerys Targaryen',
93+
'Egon Targaryen',
94+
'Rhaegar Targaryen'
95+
];
96+
97+
const targaryenTab = fixture.debugElement.queryAll(
98+
By.css('.mat-tab-label')
99+
)[1];
100+
targaryenTab.nativeElement.click();
101+
fixture.detectChanges();
102+
await fixture.whenStable();
103+
104+
const actualFamilieMemebersElements = fixture.debugElement.queryAll(
105+
By.css('li')
106+
);
107+
const actualFamilieMembers = actualFamilieMemebersElements.map(
108+
(debugElement: DebugElement) => debugElement.nativeElement.innerHTML
109+
);
110+
expect(actualFamilieMembers).toEqual(targaryens);
111+
});
89112
});

0 commit comments

Comments
 (0)