Skip to content

Commit

Permalink
Merge pull request #625 from alphagov/add-test-coverage-date-input-er…
Browse files Browse the repository at this point in the history
…ror-messages

Ensure we're testing error-messages in date-input
  • Loading branch information
NickColley authored Mar 28, 2018
2 parents 24d2eba + 03818fb commit d4d2f31
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Internal:

- Fix date-input default example
(PR [#623](https://github.com/alphagov/govuk-frontend/pull/623))
- Ensure we're testing error-messages in date-input
(PR [#625](https://github.com/alphagov/govuk-frontend/pull/625))

- Explain npm link
(PR [#624](https://github.com/alphagov/govuk-frontend/pull/624))
Expand Down
8 changes: 8 additions & 0 deletions src/date-input/__snapshots__/template.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,14 @@ exports[`Date input passes through fieldset params without breaking 1`] = `

exports[`Date input passes through html fieldset params without breaking 1`] = `
<span class="govuk-c-error-message">
Error message goes here
</span>
`;

exports[`Date input passes through html fieldset params without breaking 2`] = `
<fieldset class="govuk-c-fieldset">
<legend class="govuk-c-fieldset__legend">
What is your
Expand Down
1 change: 1 addition & 0 deletions src/date-input/template.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,7 @@ describe('Date input', () => {
]
})

expect(htmlWithClassName($, '.govuk-c-error-message')).toMatchSnapshot()
expect(htmlWithClassName($, '.govuk-c-fieldset')).toMatchSnapshot()
})
})

0 comments on commit d4d2f31

Please sign in to comment.