@@ -9,12 +9,16 @@ import {MatChipListHarness} from './chip-list-harness';
99import { MatChipHarness } from './chip-harness' ;
1010import { MatChipInputHarness } from './chip-input-harness' ;
1111import { MatChipRemoveHarness } from './chip-remove-harness' ;
12+ import { MatChipOptionHarness } from './chip-option-harness' ;
13+ import { MatChipListboxHarness } from './chip-listbox-harness' ;
1214
1315/** Shared tests to run on both the original and MDC-based chips. */
1416export function runHarnessTests (
1517 chipsModule : typeof MatChipsModule ,
1618 chipListHarness : typeof MatChipListHarness ,
19+ listboxHarness : typeof MatChipListboxHarness ,
1720 chipHarness : typeof MatChipHarness ,
21+ chipOptionHarness : typeof MatChipOptionHarness ,
1822 chipInputHarness : typeof MatChipInputHarness ,
1923 chipRemoveHarness : typeof MatChipRemoveHarness ) {
2024 let fixture : ComponentFixture < ChipsHarnessTest > ;
@@ -124,7 +128,7 @@ export function runHarnessTests(
124128 } ) ;
125129
126130 it ( 'should be able to get the selected chips in a list' , async ( ) => {
127- const chipList = await loader . getHarness ( chipListHarness ) ;
131+ const chipList = await loader . getHarness ( listboxHarness ) ;
128132 const chips = await chipList . getChips ( ) ;
129133
130134 expect ( ( await chipList . getChips ( { selected : true } ) ) . length ) . toBe ( 0 ) ;
@@ -135,7 +139,7 @@ export function runHarnessTests(
135139 } ) ;
136140
137141 it ( 'should be able to select chips based on a filter' , async ( ) => {
138- const chipList = await loader . getHarness ( chipListHarness ) ;
142+ const chipList = await loader . getHarness ( listboxHarness ) ;
139143 fixture . componentInstance . isMultiple = true ;
140144
141145 expect ( ( await chipList . getChips ( { selected : true } ) ) . length ) . toBe ( 0 ) ;
@@ -166,22 +170,22 @@ export function runHarnessTests(
166170 } ) ;
167171
168172 it ( 'should be able to select a chip' , async ( ) => {
169- const chip = await loader . getHarness ( chipHarness ) ;
173+ const chip = await loader . getHarness ( chipOptionHarness ) ;
170174 expect ( await chip . isSelected ( ) ) . toBe ( false ) ;
171175 await chip . select ( ) ;
172176 expect ( await chip . isSelected ( ) ) . toBe ( true ) ;
173177 } ) ;
174178
175179 it ( 'should be able to deselect a chip' , async ( ) => {
176- const chip = await loader . getHarness ( chipHarness ) ;
180+ const chip = await loader . getHarness ( chipOptionHarness ) ;
177181 await chip . select ( ) ;
178182 expect ( await chip . isSelected ( ) ) . toBe ( true ) ;
179183 await chip . deselect ( ) ;
180184 expect ( await chip . isSelected ( ) ) . toBe ( false ) ;
181185 } ) ;
182186
183187 it ( 'should be able to toggle the selected state of a chip' , async ( ) => {
184- const chip = await loader . getHarness ( chipHarness ) ;
188+ const chip = await loader . getHarness ( chipOptionHarness ) ;
185189 expect ( await chip . isSelected ( ) ) . toBe ( false ) ;
186190 await chip . toggle ( ) ;
187191 expect ( await chip . isSelected ( ) ) . toBe ( true ) ;
@@ -202,7 +206,7 @@ export function runHarnessTests(
202206 } ) ;
203207
204208 it ( 'should get the selected text of a chip' , async ( ) => {
205- const chips = await loader . getAllHarnesses ( chipHarness ) ;
209+ const chips = await loader . getAllHarnesses ( chipOptionHarness ) ;
206210 expect ( await Promise . all ( chips . map ( chip => chip . isSelected ( ) ) ) ) . toEqual ( [
207211 false ,
208212 false ,
0 commit comments