-
Notifications
You must be signed in to change notification settings - Fork 328
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add tests for govuk-c-tag
component
#457
Conversation
this looks good from my POV |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking good, bar one test that I don't think is doing what we need it to.
src/components/tag/template.test.js
Outdated
|
||
it('renders custom text correctly', () => { | ||
const { $ } = render('tag', { | ||
text: 'alpha' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the same text as in the default example, so we could change the logic to hard code alpha
and I think all of these tests would still pass? Suggest specifying some text that would not normally appear in any of our examples.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done!
cda2ad9
to
accf1fc
Compare
These test if the component: - renders the default example with strong tag and text correctly - renders classes correctly - renders custom text correctly - renders escaped html when passed to text - renders html correctly - renders attributes correctly
This follows our decision that examples from the component definition that are now redundant and no longer useful in the review app are removed
accf1fc
to
741e3e4
Compare
This is ready to review. I made the description of the tests resemble more closely the sort of natural language that we agreed on with the team. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
Add Jest tests for
govuk-c-tag
component.These test if the component:
Remove tag
--with-html
example from FE review app. This follows our decision that examples from the component definition that are now redundant and no longer useful in the review app are removed.Trello card: https://trello.com/c/2Mv7onR8/637-automated-tests-for-tag-component