Skip to content

Commit

Permalink
test(material-experimental/mdc-tabs): fix failing tests (angular#19165)
Browse files Browse the repository at this point in the history
Recently angular#16869 was merged which was created before we had MDC-based tabs which means that the MDC tests were never updated.
  • Loading branch information
crisbeto authored Apr 24, 2020
1 parent 495edca commit 4136a70
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -147,27 +147,29 @@ describe('MDC-based MatTabNavBar', () => {
expect(tabLinkElement.classList).toContain('mat-mdc-tab-disabled');
});

it('should re-align the ink bar when the direction changes', () => {
it('should re-align the ink bar when the direction changes', fakeAsync(() => {
const inkBar = fixture.componentInstance.tabNavBar._inkBar;

spyOn(inkBar, 'alignToElement');

dirChange.next();
tick();
fixture.detectChanges();

expect(inkBar.alignToElement).toHaveBeenCalled();
});
}));

it('should re-align the ink bar when the tabs list change', () => {
it('should re-align the ink bar when the tabs list change', fakeAsync(() => {
const inkBar = fixture.componentInstance.tabNavBar._inkBar;

spyOn(inkBar, 'alignToElement');

fixture.componentInstance.tabs = [1, 2, 3, 4];
fixture.detectChanges();
tick();

expect(inkBar.alignToElement).toHaveBeenCalled();
});
}));

it('should re-align the ink bar when the tab labels change the width', done => {
const inkBar = fixture.componentInstance.tabNavBar._inkBar;
Expand Down

0 comments on commit 4136a70

Please sign in to comment.