File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed
__tests__/integration/mirador/tests Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -42,12 +42,15 @@ describe('Annotations in Mirador', () => {
4242
4343 expect ( await screen . findByRole ( 'heading' , { name : 'Annotations' } ) ) . toBeInTheDocument ( ) ;
4444
45- expect ( await screen . findByText ( 'Showing 6 annotations' ) ) . toBeInTheDocument ( ) ;
45+ // Re. this regex: be sure that the number of annotations starts with a non zero digit
46+ const annoCountSubtitle = await screen . findByText ( / S h o w i n g [ 1 - 9 ] \d * a n n o t a t i o n s / ) ;
47+ expect ( annoCountSubtitle ) . toBeInTheDocument ( ) ;
48+ const annotationCount = annoCountSubtitle . innerText . match ( / \d + / ) [ 0 ] ;
4649
4750 const annotationPanel = await screen . findByRole ( 'complementary' , { name : / a n n o t a t i o n s / i } ) ;
4851 expect ( annotationPanel ) . toBeInTheDocument ( ) ;
4952
5053 const listItems = await within ( annotationPanel ) . findAllByRole ( 'menuitem' ) ;
51- expect ( listItems ) . toHaveLength ( 6 ) ;
54+ expect ( listItems ) . toHaveLength ( annotationCount ) ;
5255 } ) ;
5356} ) ;
You can’t perform that action at this time.
0 commit comments