From 1e193387242ce1df41fd256babb612df7a672dc5 Mon Sep 17 00:00:00 2001 From: Kristiyan Kostadinov Date: Tue, 14 Aug 2018 01:40:37 +0200 Subject: [PATCH] test(tabs): fix test failure (#12656) Fixes a test in the tab group tests due to a long-standing PR being merged. --- src/lib/tabs/tab-group.spec.ts | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/lib/tabs/tab-group.spec.ts b/src/lib/tabs/tab-group.spec.ts index dab3da38180..cf23ea453a1 100644 --- a/src/lib/tabs/tab-group.spec.ts +++ b/src/lib/tabs/tab-group.spec.ts @@ -448,7 +448,7 @@ describe('MatTabGroup', () => { expect(component._tabs.toArray()[0].isActive).toBe(true); }); - it('should be able to select a new tab after creation', () => { + it('should be able to select a new tab after creation', fakeAsync(() => { fixture.detectChanges(); const component: MatTabGroup = fixture.debugElement.query(By.css('mat-tab-group')).componentInstance; @@ -457,10 +457,11 @@ describe('MatTabGroup', () => { fixture.componentInstance.selectedIndex = 3; fixture.detectChanges(); + tick(); expect(component.selectedIndex).toBe(3); expect(component._tabs.toArray()[3].isActive).toBe(true); - }); + })); it('should not fire `selectedTabChange` when the amount of tabs changes', fakeAsync(() => { fixture.detectChanges();