@@ -309,12 +309,16 @@ describe('pos-make-findable', () => {
309309 } ;
310310 when ( mockOs . store . get ) . calledWith ( 'https://thing.example#it' ) . mockReturnValue ( { fake : 'thing' } ) ;
311311 const firstIndexAssume = jest . fn ( ) ;
312- when ( firstIndexAssume ) . calledWith ( LabelIndex ) . mockReturnValue ( { uri : 'https://pod.example/first-index' } ) ;
312+ when ( firstIndexAssume )
313+ . calledWith ( LabelIndex )
314+ . mockReturnValue ( { uri : 'https://pod.example/first-index' , contains : ( ) => false } ) ;
313315 when ( mockOs . store . get ) . calledWith ( 'https://pod.example/first-index' ) . mockReturnValue ( {
314316 assume : firstIndexAssume ,
315317 } ) ;
316318 const secondIndexAssume = jest . fn ( ) ;
317- when ( secondIndexAssume ) . calledWith ( LabelIndex ) . mockReturnValue ( { uri : 'https://pod.example/second-index' } ) ;
319+ when ( secondIndexAssume )
320+ . calledWith ( LabelIndex )
321+ . mockReturnValue ( { uri : 'https://pod.example/second-index' , contains : ( ) => true } ) ;
318322 when ( mockOs . store . get ) . calledWith ( 'https://pod.example/second-index' ) . mockReturnValue ( {
319323 assume : secondIndexAssume ,
320324 } ) ;
@@ -340,20 +344,20 @@ describe('pos-make-findable', () => {
340344 expect ( list ) . toEqualHtml ( `
341345 <ol role="listbox">
342346 <li role="option">
343- <label>
344- <input type="checkbox">
345- <pos-resource uri="https://pod.example/first-index" lazy>
346- <pos-label></pos-label>
347- </pos-resource>
348- </label>
347+ <label>
348+ <input type="checkbox">
349+ <pos-resource uri="https://pod.example/first-index" lazy>
350+ <pos-label></pos-label>
351+ </pos-resource>
352+ </label>
349353 </li>
350354 <li role="option">
351- <label>
352- <input type="checkbox">
353- <pos-resource uri="https://pod.example/second-index" lazy>
354- <pos-label></pos-label>
355- </pos-resource>
356- </label>
355+ <label>
356+ <input checked type="checkbox">
357+ <pos-resource uri="https://pod.example/second-index" lazy>
358+ <pos-label></pos-label>
359+ </pos-resource>
360+ </label>
357361 </li>
358362 </ol>` ) ;
359363 } ) ;
@@ -374,7 +378,7 @@ describe('pos-make-findable', () => {
374378 // then the thing is added to the index
375379 expect ( mockOs . addToLabelIndex ) . toHaveBeenCalledWith (
376380 { fake : 'thing' } ,
377- { uri : 'https://pod.example/first-index' } ,
381+ expect . objectContaining ( { uri : 'https://pod.example/first-index' } ) ,
378382 ) ;
379383 await page . waitForChanges ( ) ;
380384
0 commit comments