Skip to content

Commit 8187ac7

Browse files
committed
Fixing test
1 parent f213968 commit 8187ac7

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

test/form/file-upload.test.js

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,14 @@ describe('File upload POST tests', () => {
211211

212212
expect(response.statusCode).toBe(StatusCodes.OK)
213213

214-
const $errorSummary = container.getByRole('alert')
214+
const $errorSummary = container
215+
.getAllByRole('alert')
216+
.find((el) => within(el).queryAllByRole('listitem').length)
217+
218+
if (!$errorSummary) {
219+
throw new Error('Unable to find error summary')
220+
}
221+
215222
const $errorItems = within($errorSummary).getAllByRole('listitem')
216223

217224
const $heading = within($errorSummary).getByRole('heading', {

0 commit comments

Comments
 (0)