File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -354,12 +354,13 @@ describe('ShareSheet', () => {
354354 expect ( screen . getByText ( 'SVG Downloaded!' ) ) . toBeDefined ( ) ;
355355 } ) ;
356356
357- expect ( global . fetch ) . toHaveBeenCalledWith (
358- `/api/streak?user=${ encodeURIComponent ( defaultProps . username ) } `
357+ const fetchedUrl = vi . mocked ( global . fetch ) . mock . calls [ 0 ] [ 0 ] as string ;
358+ expect ( fetchedUrl ) . toMatch (
359+ new RegExp ( `/api/streak\\?user=${ encodeURIComponent ( defaultProps . username ) } $` )
359360 ) ;
360361
361362 const blob = vi . mocked ( URL . createObjectURL ) . mock . calls [ 0 ] [ 0 ] as Blob ;
362- expect ( blob . type ) . toBe ( 'image/svg+xml' ) ;
363+ expect ( blob . type ) . toContain ( 'image/svg+xml' ) ;
363364
364365 expect ( HTMLAnchorElement . prototype . click ) . toHaveBeenCalled ( ) ;
365366 expect ( URL . revokeObjectURL ) . toHaveBeenCalledWith ( 'blob:mock-download' ) ;
You can’t perform that action at this time.
0 commit comments