Skip to content

Allow component examples to define custom supporting HTML for tests (fixes #6702 )#6713

Open
moshaid wants to merge 8 commits intoalphagov:mainfrom
moshaid:HTML-Component
Open

Allow component examples to define custom supporting HTML for tests (fixes #6702 )#6713
moshaid wants to merge 8 commits intoalphagov:mainfrom
moshaid:HTML-Component

Conversation

@moshaid
Copy link

@moshaid moshaid commented Feb 5, 2026

This PR addresses the small story on #6702

What Changed

Removed hardcoded markup from "components.template.test.js" and added a supportingHTML field so examples can declare their own supporting HTML.

Changes

  • Added optional supportingHTML field to component example YAML files
  • Updated fixture generation to include supportingHTML in fixture objects
  • Removed hardcoded
    from test file
  • Test file now reads fixture.supportingHTML instead of hardcoding markup
  • Updated label component "for" example to use supportingHTML with an input element
  • Added supportingHTML to ComponentExample type definition

moshaid and others added 2 commits February 20, 2026 22:03
Resolved conflict in components.template.test.js by keeping the
data-driven supportingHTML field approach and removing hardcoded
conditional logic. This maintains the solution that meets the
'Done when' criteria of not defining markup in the test file.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant