Skip to content

Commit a19c60c

Browse files
crisbetommalerba
authored andcommitted
test(tabs): fix test failure (#12656)
Fixes a test in the tab group tests due to a long-standing PR being merged.
1 parent 75632bd commit a19c60c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/lib/tabs/tab-group.spec.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ describe('MatTabGroup', () => {
448448
expect(component._tabs.toArray()[0].isActive).toBe(true);
449449
});
450450

451-
it('should be able to select a new tab after creation', () => {
451+
it('should be able to select a new tab after creation', fakeAsync(() => {
452452
fixture.detectChanges();
453453
const component: MatTabGroup =
454454
fixture.debugElement.query(By.css('mat-tab-group')).componentInstance;
@@ -457,10 +457,11 @@ describe('MatTabGroup', () => {
457457
fixture.componentInstance.selectedIndex = 3;
458458

459459
fixture.detectChanges();
460+
tick();
460461

461462
expect(component.selectedIndex).toBe(3);
462463
expect(component._tabs.toArray()[3].isActive).toBe(true);
463-
});
464+
}));
464465

465466
it('should not fire `selectedTabChange` when the amount of tabs changes', fakeAsync(() => {
466467
fixture.detectChanges();

0 commit comments

Comments
 (0)