Skip to content

Commit

Permalink
test(tabs): fix test failure (#12656)
Browse files Browse the repository at this point in the history
Fixes a test in the tab group tests due to a long-standing PR being merged.
  • Loading branch information
crisbeto authored and mmalerba committed Aug 20, 2018
1 parent 75632bd commit a19c60c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/lib/tabs/tab-group.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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();
Expand Down

0 comments on commit a19c60c

Please sign in to comment.