Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,10 @@
<div id="uploadedFilesContainer">
<h2 class="govuk-heading-m">Uploaded files</h2>
{% if upload.count %}
<p class="govuk-body">{{upload.count}} file{{ "s" if upload.count > 1}} uploaded</p>
<p class="govuk-body" role="alert">{{upload.count}} file{{ "s" if upload.count > 1}} uploaded</p>
<p class="govuk-body">
</p>

<div class="govuk-visually-hidden" aria-live="polite" id="statusInformation">
{{upload.count}} file{{ "s" if upload.count > 1}} uploaded
</div>

{% if upload.summaryList.rows | length %}
{{ govukSummaryList(upload.summaryList) }}
{% endif %}
Expand Down
9 changes: 8 additions & 1 deletion test/form/file-upload.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,14 @@ describe('File upload POST tests', () => {

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

const $errorSummary = container.getByRole('alert')
const $errorSummary = container
.getAllByRole('alert')
.find((el) => within(el).queryAllByRole('listitem').length)

if (!$errorSummary) {
throw new Error('Unable to find error summary')
}

const $errorItems = within($errorSummary).getAllByRole('listitem')

const $heading = within($errorSummary).getByRole('heading', {
Expand Down
Loading