Use button element for entire input replacement #13066
tests.yml
on: pull_request
Matrix: Install
Matrix: Build
Diff changes to npm package
/
Generate diff
1m 13s
Stats comment
/
Generate stats
31s
Matrix: lint
Percy
/
Send screenshots
1m 23s
Matrix: Bundler integrations / Test tree shaking
Matrix: package
Matrix: test
Matrix: verify
Annotations
20 errors
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › choose file button › renders the button element:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L92
expect(received).toBe(expected) // Object.is equality
Expected: "button"
Received: null
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:92:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › choose file button › renders the button with default text:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L100
expect(received).toBe(expected) // Object.is equality
Expected: "Choose file"
Received: "<span class=\"govuk-button govuk-button--secondary govuk-file-upload__pseudo-button\">Choose file</span><span class=\"govuk-body govuk-file-upload__status\">No file chosen</span>"
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:100:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › status element › renders the status element with role:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L116
expect(received).toBe(expected) // Object.is equality
Expected: "status"
Received: null
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:116:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › i18n › uses the correct translation for the choose file button:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L259
expect(received).toBe(expected) // Object.is equality
Expected: "Dewiswch ffeil"
Received: "<span class=\"govuk-button govuk-button--secondary govuk-file-upload__pseudo-button\">Dewiswch ffeil</span><span class=\"govuk-body govuk-file-upload__status\">Dim ffeiliau wedi'u dewis</span>"
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:259:30)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › disables the button if the input is disabled on page load:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L295
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:295:34)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › disables the button if the input is disabled programatically:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L309
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:309:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › enables the button if the input is enabled programatically:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L327
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:327:40)
|
JavaScript component tests (ubuntu-22.04)
Process completed with exit code 1.
|
/components/file-upload › component examples › passes accessibility tests:
packages/govuk-frontend/src/govuk/components/file-upload/accessibility.puppeteer.test.mjs#L11
expect(received).toHaveNoViolations(expected)
Expected the HTML found at $('.govuk-button') to have no violations:
<span class="govuk-button govuk-button--secondary govuk-file-upload__pseudo-button">Choose file</span>
Received:
"Elements must meet minimum color contrast ratio thresholds (color-contrast)"
Fix any of the following:
Element has insufficient color contrast of 3.46 (foreground color: #858686, background color: #f9f9f8, font size: 14.3pt (19px), font weight: normal). Expected contrast ratio of 4.5:1
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=axe-puppeteer
http://localhost:8080/components/file-upload/disabled/preview
at Object.toHaveNoViolations (node_modules/expect/build/index.js:174:22)
at Object.toHaveNoViolations (packages/govuk-frontend/src/govuk/components/file-upload/accessibility.puppeteer.test.mjs:11:42)
|
Accessibility tests (ubuntu-22.04)
Process completed with exit code 1.
|
/components/file-upload › component examples › passes accessibility tests:
packages/govuk-frontend/src/govuk/components/file-upload/accessibility.puppeteer.test.mjs#L11
expect(received).toHaveNoViolations(expected)
Expected the HTML found at $('.govuk-button') to have no violations:
<span class="govuk-button govuk-button--secondary govuk-file-upload__pseudo-button">Choose file</span>
Received:
"Elements must meet minimum color contrast ratio thresholds (color-contrast)"
Fix any of the following:
Element has insufficient color contrast of 3.46 (foreground color: #858686, background color: #f9f9f8, font size: 14.3pt (19px), font weight: normal). Expected contrast ratio of 4.5:1
You can find more information on this issue here:
https://dequeuniversity.com/rules/axe/4.10/color-contrast?application=axe-puppeteer
http://localhost:8080/components/file-upload/disabled/preview
at Object.toHaveNoViolations (node_modules/expect/build/index.js:174:22)
at Object.toHaveNoViolations (packages/govuk-frontend/src/govuk/components/file-upload/accessibility.puppeteer.test.mjs:11:42)
|
Accessibility tests (windows-latest)
Process completed with exit code 1.
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › choose file button › renders the button element:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L92
expect(received).toBe(expected) // Object.is equality
Expected: "button"
Received: null
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:92:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › choose file button › renders the button with default text:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L100
expect(received).toBe(expected) // Object.is equality
Expected: "Choose file"
Received: "<span class=\"govuk-button govuk-button--secondary govuk-file-upload__pseudo-button\">Choose file</span><span class=\"govuk-body govuk-file-upload__status\">No file chosen</span>"
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:100:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › on page load › status element › renders the status element with role:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L116
expect(received).toBe(expected) // Object.is equality
Expected: "status"
Received: null
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:116:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › i18n › uses the correct translation for the choose file button:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L259
expect(received).toBe(expected) // Object.is equality
Expected: "Dewiswch ffeil"
Received: "<span class=\"govuk-button govuk-button--secondary govuk-file-upload__pseudo-button\">Dewiswch ffeil</span><span class=\"govuk-body govuk-file-upload__status\">Dim ffeiliau wedi'u dewis</span>"
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:259:30)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › disables the button if the input is disabled on page load:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L295
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:295:34)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › disables the button if the input is disabled programatically:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L309
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:309:39)
|
/components/file-upload › /components/file-upload/preview › when JavaScript is available › disabled state syncing › enables the button if the input is enabled programatically:
packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js#L327
expect(received).toBeTruthy()
Received: false
at Object.<anonymous> (packages/govuk-frontend/src/govuk/components/file-upload/file-upload.puppeteer.test.js:327:40)
|
JavaScript component tests (windows-latest)
Process completed with exit code 1.
|
Artifacts
Produced during runtime
Name | Size | |
---|---|---|
JavaScript behaviour tests coverage (ubuntu-22.04)
|
235 KB |
|
JavaScript behaviour tests coverage (windows-latest)
|
235 KB |
|
JavaScript unit tests coverage (ubuntu-22.04)
|
214 KB |
|
JavaScript unit tests coverage (windows-latest)
|
214 KB |
|
Package diff
|
9.13 KB |
|