@@ -13,7 +13,11 @@ import {MatActionListHarness, MatActionListItemHarness} from './action-list-harn
1313import { MatListHarness , MatListItemHarness } from './list-harness' ;
1414import { MatListHarnessBase } from './list-harness-base' ;
1515import { BaseListItemHarnessFilters } from './list-harness-filters' ;
16- import { MatListItemHarnessBase , MatSubheaderHarness } from './list-item-harness-base' ;
16+ import {
17+ MatListItemHarnessBase ,
18+ MatListItemSection ,
19+ MatSubheaderHarness
20+ } from './list-item-harness-base' ;
1721import { MatNavListHarness , MatNavListItemHarness } from './nav-list-harness' ;
1822import { MatListOptionHarness , MatSelectionListHarness } from './selection-list-harness' ;
1923
@@ -33,7 +37,8 @@ function runBaseListFunctionalityTests<
3337 } ,
3438 listItemHarnessBase : typeof MatListItemHarnessBase ,
3539 subheaderHarness : typeof MatSubheaderHarness ,
36- dividerHarness : typeof MatDividerHarness ) {
40+ dividerHarness : typeof MatDividerHarness ,
41+ selectors : { content : string } ) {
3742 describe ( 'base list functionality' , ( ) => {
3843 let simpleListHarness : L ;
3944 let emptyListHarness : L ;
@@ -183,6 +188,13 @@ function runBaseListFunctionalityTests<
183188 const childHarness = await items [ 1 ] . getHarness ( TestItemContentHarness ) ;
184189 expect ( childHarness ) . not . toBeNull ( ) ;
185190 } ) ;
191+
192+ it ( 'should be able to get content harness loader of list item' , async ( ) => {
193+ const items = await simpleListHarness . getItems ( ) ;
194+ expect ( items . length ) . toBe ( 3 ) ;
195+ const loader = await items [ 1 ] . getChildLoader ( selectors . content as MatListItemSection ) ;
196+ await expectAsync ( loader . getHarness ( TestItemContentHarness ) ) . toBeResolved ( ) ;
197+ } ) ;
186198 } ) ;
187199}
188200
@@ -199,17 +211,18 @@ export function runHarnessTests(
199211 selectionListHarness : typeof MatSelectionListHarness ,
200212 listItemHarnessBase : typeof MatListItemHarnessBase ,
201213 subheaderHarness : typeof MatSubheaderHarness ,
202- dividerHarness : typeof MatDividerHarness ) {
214+ dividerHarness : typeof MatDividerHarness ,
215+ selectors : { content : string } ) {
203216 describe ( 'MatListHarness' , ( ) => {
204217 runBaseListFunctionalityTests < MatListHarness , MatListItemHarness > (
205218 ListHarnessTest , listModule , listHarness , listItemHarnessBase , subheaderHarness ,
206- dividerHarness ) ;
219+ dividerHarness , selectors ) ;
207220 } ) ;
208221
209222 describe ( 'MatActionListHarness' , ( ) => {
210223 runBaseListFunctionalityTests < MatActionListHarness , MatActionListItemHarness > (
211224 ActionListHarnessTest , listModule , actionListHarness , listItemHarnessBase , subheaderHarness ,
212- dividerHarness ) ;
225+ dividerHarness , selectors ) ;
213226
214227 describe ( 'additional functionality' , ( ) => {
215228 let harness : MatActionListHarness ;
@@ -244,7 +257,7 @@ export function runHarnessTests(
244257 describe ( 'MatNavListHarness' , ( ) => {
245258 runBaseListFunctionalityTests < MatNavListHarness , MatNavListItemHarness > (
246259 NavListHarnessTest , listModule , navListHarness , listItemHarnessBase , subheaderHarness ,
247- dividerHarness ) ;
260+ dividerHarness , selectors ) ;
248261
249262 describe ( 'additional functionality' , ( ) => {
250263 let harness : MatNavListHarness ;
@@ -290,7 +303,7 @@ export function runHarnessTests(
290303 describe ( 'MatSelectionListHarness' , ( ) => {
291304 runBaseListFunctionalityTests < MatSelectionListHarness , MatListOptionHarness > (
292305 SelectionListHarnessTest , listModule , selectionListHarness , listItemHarnessBase ,
293- subheaderHarness , dividerHarness ) ;
306+ subheaderHarness , dividerHarness , selectors ) ;
294307
295308 describe ( 'additional functionality' , ( ) => {
296309 let harness : MatSelectionListHarness ;
0 commit comments