Skip to content

Commit

Permalink
Merge pull request #4042 from alphagov/component-fixtures
Browse files Browse the repository at this point in the history
Read component data from built `fixtures.json`
  • Loading branch information
colinrotherham authored Aug 14, 2023
2 parents 702c899 + 08f1605 commit 6657a6e
Show file tree
Hide file tree
Showing 35 changed files with 639 additions and 629 deletions.
26 changes: 13 additions & 13 deletions src/govuk/components/accordion/accordion.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ params:

examples:
- name: default
data:
options:
id: default-example
items:
- heading:
Expand All @@ -110,7 +110,7 @@ examples:
</ul>
- name: with additional descriptions
data:
options:
id: with-descriptions
items:
- heading:
Expand All @@ -136,7 +136,7 @@ examples:
</ul>
- name: with long content and description
data:
options:
id: with-long-content-and-description
items:
- heading:
Expand All @@ -159,7 +159,7 @@ examples:
</ul>
- name: with one section open
data:
options:
id: one-section-open-example
items:
- heading:
Expand All @@ -179,7 +179,7 @@ examples:
</ul>
- name: with all sections already open
data:
options:
id: all-sections-open-example
items:
- heading:
Expand All @@ -200,7 +200,7 @@ examples:
</ul>
- name: with focusable elements inside
data:
options:
id: with-focusable-elements
items:
- heading:
Expand All @@ -213,7 +213,7 @@ examples:
html: <a class="govuk-link" href="#">Link B</a>

- name: with translations
data:
options:
id: with-translations
hideAllSectionsText: Collapse all sections
showAllSectionsText: Expand all sections
Expand All @@ -237,7 +237,7 @@ examples:
# Hidden examples are not shown in the review app, but are used for tests and HTML fixtures
- name: classes
hidden: true
data:
options:
id: accordion-classes
classes: myClass
items:
Expand All @@ -247,7 +247,7 @@ examples:
text: Some content
- name: attributes
hidden: true
data:
options:
id: accordion-attributes
attributes:
data-attribute: value
Expand All @@ -258,7 +258,7 @@ examples:
text: Some content
- name: custom heading level
hidden: true
data:
options:
id: accordion-heading
headingLevel: 3
items:
Expand All @@ -268,7 +268,7 @@ examples:
text: Some content
- name: heading html
hidden: true
data:
options:
id: accordion-heading-html
items:
- heading:
Expand All @@ -277,7 +277,7 @@ examples:
text: Some content
- name: with falsey values
hidden: true
data:
options:
id: accordion-falsey
items:
- heading:
Expand All @@ -293,7 +293,7 @@ examples:
text: Some content
- name: with remember expanded off
hidden: true
data:
options:
id: accordion-remember-expanded-off
rememberExpanded: false
items:
Expand Down
14 changes: 7 additions & 7 deletions src/govuk/components/back-link/back-link.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,38 +22,38 @@ params:

examples:
- name: default
data:
options:
href: '#'
- name: with custom text
data:
options:
href: '#'
text: Back to home
- name: inverse
previewLayoutModifiers:
- inverse
data:
options:
classes: govuk-back-link--inverse
href: '#'

# Hidden examples are not shown in the review app, but are used for tests and HTML fixtures
- name: classes
hidden: true
data:
options:
classes: app-back-link--custom-class
href: '#'
- name: html as text
hidden: true
data:
options:
text: <b>Home</b>
href: '#'
- name: html
hidden: true
data:
options:
html: <b>Back</b>
href: '#'
- name: attributes
hidden: true
data:
options:
href: '#'
html: <b>Back to home</b>
attributes:
Expand Down
24 changes: 12 additions & 12 deletions src/govuk/components/breadcrumbs/breadcrumbs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,19 +35,19 @@ params:

examples:
- name: default
data:
options:
items:
- text: Section
href: '/section'
- text: Sub-section
href: '/section/sub-section'
- name: with one level
data:
options:
items:
- text: Section
href: '/section'
- name: with multiple levels
data:
options:
items:
- text: Home
href: '/'
Expand All @@ -58,22 +58,22 @@ examples:
- text: Sub Sub-section
href: '/section/sub-section/sub-sub-section'
- name: without the home section
data:
options:
items:
- text: Service Manual
href: '/service-manual'
- text: Agile Delivery
href: '/service-manual/agile-delivery'
- name: with last breadcrumb as current page
data:
options:
items:
- text: Home
href: '/'
- text: Passports, travel and living abroad
href: '/browse/abroad'
- text: Travel abroad
- name: with collapse on mobile
data:
options:
collapseOnMobile: true
items:
- text: Home
Expand All @@ -86,7 +86,7 @@ examples:
description: Breadcrumbs that appear on dark backgrounds
previewLayoutModifiers:
- inverse
data:
options:
classes: govuk-breadcrumbs--inverse
items:
- text: Home
Expand All @@ -98,21 +98,21 @@ examples:
# Hidden examples are not shown in the review app, but are used for tests and HTML fixtures
- name: classes
hidden: true
data:
options:
classes: app-breadcrumbs--custom-modifier
items:
- text: Home
- name: attributes
hidden: true
data:
options:
attributes:
id: my-navigation
role: navigation
items:
- text: Home
- name: item attributes
hidden: true
data:
options:
items:
- text: Section 1
href: /section
Expand All @@ -121,12 +121,12 @@ examples:
data-attribute-2: my-attribute-2
- name: html as text
hidden: true
data:
options:
items:
- text: <span>Section 1</span>
- name: html
hidden: true
data:
options:
items:
- html: <em>Section 1</em>
- html: <em>Section 2</em>
Expand Down
Loading

0 comments on commit 6657a6e

Please sign in to comment.