File tree Expand file tree Collapse file tree 1 file changed +12
-7
lines changed
packages/tts-react/__tests__ Expand file tree Collapse file tree 1 file changed +12
-7
lines changed Original file line number Diff line number Diff line change @@ -370,12 +370,17 @@ describe('useTts', () => {
370370 )
371371
372372 expect ( result . current . spokenText ) . toBe ( testText )
373- expect ( mockRender ) . toHaveBeenCalledWith ( {
374- children : testText ,
375- boundary : expect . any ( Object ) ,
376- markTextAsSpoken : true ,
377- markColor : undefined ,
378- markBackgroundColor : undefined
379- } )
373+ expect ( mockRender ) . toHaveBeenCalledTimes ( 1 )
374+ const callArgs = mockRender . mock . calls [ 0 ] [ 0 ]
375+ expect ( callArgs . children ) . toBe ( testText )
376+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
377+ expect ( typeof callArgs . boundary . word ) . toBe ( 'string' )
378+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
379+ expect ( typeof callArgs . boundary . startChar ) . toBe ( 'number' )
380+ // eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
381+ expect ( typeof callArgs . boundary . endChar ) . toBe ( 'number' )
382+ expect ( callArgs . markTextAsSpoken ) . toBe ( true )
383+ expect ( callArgs . markColor ) . toBeUndefined ( )
384+ expect ( callArgs . markBackgroundColor ) . toBeUndefined ( )
380385 } )
381386} )
You can’t perform that action at this time.
0 commit comments