mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
test(tabs): fix test failure (#12656)
Fixes a test in the tab group tests due to a long-standing PR being merged.
This commit is contained in:
committed by
mmalerba
parent
f16795930a
commit
1e19338724
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user