alphagov / govuk-frontend

GOV.UK Frontend contains the code you need to start building a user interface for government platforms and services.
https://frontend.design-system.service.gov.uk/
MIT License
1.17k stars 320 forks source link

Define additional screenshots in component YAML #5041

Closed 36degrees closed 3 months ago

36degrees commented 3 months ago

Rather than hardcoding the list of additional examples to screenshot in the task, add a new screenshot boolean to the component YAML (and generated fixtures.yaml) which determines whether the example should be included in the screenshots or not.

Preserve the existing list of screenshotted examples by setting screenshot: true in the YAML for those examples.

Remove special treatment of examples named ‘inverse’ but retain their screenshots by also setting screenshot: true.

github-actions[bot] commented 3 months ago

:clipboard: Stats

File sizes

File Size
dist/govuk-frontend-development.min.css 113.37 KiB
dist/govuk-frontend-development.min.js 42.34 KiB
packages/govuk-frontend/dist/govuk/all.bundle.js 88.16 KiB
packages/govuk-frontend/dist/govuk/all.bundle.mjs 82.83 KiB
packages/govuk-frontend/dist/govuk/all.mjs 981 B
packages/govuk-frontend/dist/govuk/govuk-frontend-component.mjs 359 B
packages/govuk-frontend/dist/govuk/govuk-frontend.min.css 113.36 KiB
packages/govuk-frontend/dist/govuk/govuk-frontend.min.js 42.33 KiB
packages/govuk-frontend/dist/govuk/i18n.mjs 5.55 KiB
packages/govuk-frontend/dist/govuk/init.mjs 4.86 KiB

Modules

File Size (bundled) Size (minified)
all.mjs 78.45 KiB 40.31 KiB
accordion.mjs 22.71 KiB 12.85 KiB
button.mjs 5.98 KiB 2.69 KiB
character-count.mjs 22.4 KiB 9.92 KiB
checkboxes.mjs 5.83 KiB 2.83 KiB
error-summary.mjs 7.89 KiB 3.46 KiB
exit-this-page.mjs 17.1 KiB 9.26 KiB
header.mjs 4.46 KiB 2.6 KiB
notification-banner.mjs 6.26 KiB 2.62 KiB
password-input.mjs 15.15 KiB 7.25 KiB
radios.mjs 4.83 KiB 2.38 KiB
skip-link.mjs 4.39 KiB 2.18 KiB
tabs.mjs 10.13 KiB 6.11 KiB

View stats and visualisations on the review app


Action run for 899012cf997c7317908ebfd678e246e0297a0b13

github-actions[bot] commented 3 months ago

Other changes to npm package

The diff could not be posted as a comment. You can download it from the workflow artifacts.


Action run for 899012cf997c7317908ebfd678e246e0297a0b13

36degrees commented 3 months ago

The tests are failing because the snapshot names are different – the screenshots used to use the 'kebab case' example names hard coded in the task, and now they're using the examples names as they appear in the YAML which are typically space separated.

So Percy is showing this as 6 missing screenshots and 6 new screenshots.

Do we think it's important to maintain the existing screenshot names? It might cause some PRs to fail if they're not up to date with the changes introduced in this PR.

If not, we can simply approve the changes in Percy and move on.