-
Notifications
You must be signed in to change notification settings - Fork 332
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
fix: [M3-7725] - Unit tests button enabled assertions #10142
Conversation
Coverage Report: β
|
The PR that originally changed the button disable behavior (#10028) also included a bunch of unit test changes to check explicitly for |
@jdamore-linode I don't think it's too important? checking for This PR really just aims to future-proof new disabled 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.
This is great, thanks @abailly-akamai!
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.
Description π
Since we changed our buttons to feature an aria tag VS using a
disabled
attribute, bothtoBeEnabled
&toBeDisabled
can lead to false positives.The reason is, the
jest-dom
assertion fortoBeEnabled
will look for adisabled
attribute which isn't going to be present since we've altered our Button to feature anaria-disabled
tag instead, leading to a false positive.We've applied the fix for our e2e but the unit suite configuration needed to be handled as well.
Changes π
toBeEnabled
&toBeDisabled
assertions (for buttons only) that checks foraria-disabled
tags as wellHow to test π§ͺ
Reproduction steps
CloseAccountSetting
component locally (on develop branch)true
yarn test CloseAccountSetting.test.tsx
- this assertion will still pass, which is a false positiveVerification steps
yarn test
and Make sure the whole suite runsAs an Author I have considered π€
Check all that apply