diff --git a/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/ChronoChart.test.tsx b/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/ChronoChart.test.tsx index 80649420954..268d670152b 100644 --- a/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/ChronoChart.test.tsx +++ b/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/ChronoChart.test.tsx @@ -11,7 +11,7 @@ describe('ChronoChart', () => { }); test('dialog open and close', async () => { - const { getAllByRole, user } = mount( + const { getAllByRole, getByRole, queryAllByRole, user } = mount( @@ -21,14 +21,16 @@ describe('ChronoChart', () => { await user.click(button); - const dialog = getAllByRole('dialog')[0]; - - expect(dialog).toMatchSnapshot(); + expect( + getByRole('heading', { name: 'Chronostratigraphic Chart' }) + ).toBeInTheDocument(); + expect(getByRole('img', { name: 'Chrono Chart' })).toBeInTheDocument(); + expect(getAllByRole('dialog')).toHaveLength(1); const closeButton = getAllByRole('button')[4]; await user.click(closeButton); - expect(() => getAllByRole('dialog')).toThrow(); + expect(queryAllByRole('dialog')).toHaveLength(0); }); }); diff --git a/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/__snapshots__/ChronoChart.test.tsx.snap b/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/__snapshots__/ChronoChart.test.tsx.snap index 75e38ae9663..11afa93051b 100644 --- a/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/__snapshots__/ChronoChart.test.tsx.snap +++ b/specifyweb/frontend/js_src/lib/components/Attachments/__tests__/__snapshots__/ChronoChart.test.tsx.snap @@ -1,158 +1,5 @@ // Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing -exports[`ChronoChart dialog open and close 1`] = ` - -`; - exports[`ChronoChart simple render 1`] = `