-
Notifications
You must be signed in to change notification settings - Fork 318
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
test(angular): Add @testing-library/angular
#3255
Conversation
|
componentProperties: { label: 'Password', fieldId: 'mockId' }, | ||
} | ||
); | ||
expect(container).toMatchSnapshot(); |
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.
Snapshot tests are a great start, but we should also verify that the button is rendered with the correct label
perhaps using screen.getByText
query. Same comment for the other tests, we could add more assertions.
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.
Right, I 100% agree. However I wanted to scope this PR just for setting up @testing-library/angular
(we have been blocked on this for a while). Then I will make follow up PRs, across Angular and Vue, to establish those tests and also align any visual differences (e.g. #2875 that is WIP).
Does that sound good to you?
Description of changes
We were previously blocked on adding
dom-testing-library
to Angular because we were on unsupported version of Angular. Now that we've bumped to Angular 12, we can use@testing-library/angular
.Added snapshot test for all primitives while I was here. Other tests will follow in later PRs; purpose of this PR is to get testing library set up with some active tests running.
Issue #, if available
will unblock #2875
Description of how you validated changes
CI
Checklist
yarn test
passesBy submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.