Skip to content

Commit 92f1c08

Browse files
Merge pull request #4159 from ProjectMirador/update-annotation-count-for-test
Fix annotations integration test by updating the number of annotations (again)
2 parents d6e5cc3 + cb10149 commit 92f1c08

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

__tests__/integration/mirador/tests/annotations.test.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff 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(/Showing [1-9]\d* annotations/);
47+
expect(annoCountSubtitle).toBeInTheDocument();
48+
const annotationCount = annoCountSubtitle.innerText.match(/\d+/)[0];
4649

4750
const annotationPanel = await screen.findByRole('complementary', { name: /annotations/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
});

0 commit comments

Comments
 (0)