diff --git a/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js b/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js index 96a06b5427..0ffd0f498a 100644 --- a/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js +++ b/services/web/test/frontend/features/pdf-preview/components/pdf-preview.test.js @@ -289,7 +289,7 @@ describe('', function () { expect(fetchMock.calls()).to.have.length(3) }) - it('displays an error message if there was a compile error', async function () { + describe('displays error messages', function () { const compileErrorStatuses = { 'clear-cache': 'Sorry, something went wrong and your project could not be compiled. Please try again in a few moments.', @@ -313,17 +313,19 @@ describe('', function () { } for (const [status, message] of Object.entries(compileErrorStatuses)) { - cleanup() - fetchMock.restore() - mockCompileError(status) + it(`displays error message for '${status}' status`, async function () { + cleanup() + fetchMock.restore() + mockCompileError(status) - renderWithEditorContext(, { scope }) + renderWithEditorContext(, { scope }) - // wait for "compile on load" to finish - await screen.findByRole('button', { name: 'Compiling…' }) - await screen.findByRole('button', { name: 'Recompile' }) + // wait for "compile on load" to finish + await screen.findByRole('button', { name: 'Compiling…' }) + await screen.findByRole('button', { name: 'Recompile' }) - screen.getByText(message) + screen.getByText(message) + }) } })