diff --git a/src/lib/chips/chip-list.spec.ts b/src/lib/chips/chip-list.spec.ts index 8631b46365ae..ec707746d1b3 100644 --- a/src/lib/chips/chip-list.spec.ts +++ b/src/lib/chips/chip-list.spec.ts @@ -181,7 +181,7 @@ describe('MatChipList', () => { midItem.focus(); // Destroy the middle item - testComponent.remove = 2; + testComponent.chips.splice(2, 1); fixture.detectChanges(); // It focuses the 4th item (now at index 2) @@ -197,7 +197,7 @@ describe('MatChipList', () => { lastItem.focus(); // Destroy the last item - testComponent.remove = lastIndex; + testComponent.chips.pop(); fixture.detectChanges(); // It focuses the next-to-last item @@ -214,7 +214,7 @@ describe('MatChipList', () => { zone.simulateZoneExit(); // Destroy the middle item - testComponent.remove = 2; + testComponent.chips.splice(2, 1); fixture.detectChanges(); // Should not have focus @@ -1305,22 +1305,18 @@ describe('MatChipList', () => { @Component({ template: ` -
-
- - {{name}} {{i + 1}} - -
-
+ + {{name}} {{i + 1}} +
` }) class StandardChipList { name: string = 'Test'; selectable: boolean = true; - remove: number; chipSelect: (index?: number) => void = () => {}; chipDeselect: (index?: number) => void = () => {}; tabIndex: number = 0; + chips = [0, 1, 2, 3, 4]; } @Component({ @@ -1576,12 +1572,10 @@ class StandardChipListWithAnimations { template: ` -
- - Chip {{i + 1}} - Remove - -
+ + Chip {{i + 1}} + Remove +
`