-
Notifications
You must be signed in to change notification settings - Fork 0
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
[Feature] Alert unit tests #301
Conversation
@@ -45,8 +45,8 @@ describe('Button', () => { | |||
expect(onPressSpy).toBeCalled() | |||
}) | |||
|
|||
it('should render label', async () => { |
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.
Is there any harm in having things async even when they don't need to be?
With Link opted to have most async because I was getting confusing errors without it for some tests.
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.
I don't think so but we should avoid adding it if there's no async functions within. I think the errors might stem from some of the queries being async functions (e.g. findBy*) and some are not (queryBy*). When we add the jest matchers eslint plugin I think it provides some guidance on which ones should be used.
Co-authored-by: Tim R <[email protected]>
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.
Dropping request changes to denote end of first pass--mostly just a few minor things for direct comments.
Non-direct comment: doesn't test accessibility. Seems like at a minimum should check header/description-a11yLabel overrides. Maybe should also check the icon scaling for the main icon and the chevron with its' unique behavior if we can do that around prior knowledge it renders everything at like 200% or whatever.
…te expand/collapse tests for better clarity.
…tment-of-veterans-affairs/va-mobile-library into feature/198-narin-alert-unit-tests
Moved accessibility tests to be a part of #279. Ready for another round of review. |
Co-authored-by: Tim R <[email protected]>
Co-authored-by: Tim R <[email protected]>
Description of Change
Adds the following unit tests for Alert:
This PR also renames the
testId
prop in Alert totestID
to be consistent the other components and fixes one of the Button tests to use queryByText instead of the async findByText.Note: Moved accessibility tests to #279 since we'll want to configure jest matchers
Testing Packages
N/A
Screenshots/Video
Testing
N/A, they're unit tests
PR Checklist
Code reviewer validation:
changelog
label applied if it's to be included in the changelogPublish
If changes warrant a new version per the versioning guidelines and the PR is approved and ready to merge:
main
into branchmain