Skip to content
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: switch Popover tests to react testing library #1505

Merged
merged 4 commits into from
Jul 2, 2024
Merged

Conversation

denysfedorov
Copy link
Contributor

@denysfedorov denysfedorov commented Jun 6, 2024

Issue #1159

This PR switches the Popover tests to React Testing Library.

Validation steps

Run yarn test
See that there are coverage percentages in the table
Verify that the tests are converted properly

@denysfedorov denysfedorov self-assigned this Jun 6, 2024
@denysfedorov denysfedorov requested a review from a team as a code owner June 6, 2024 13:35
Copy link

This pull request is automatically being deployed by Amplify Hosting (learn more).

Access this pull request here: https://pr-1505.d15792l1n26ww3.amplifyapp.com

@denysfedorov denysfedorov marked this pull request as draft June 7, 2024 10:40
@denysfedorov denysfedorov marked this pull request as ready for review June 7, 2024 13:02
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's a bunch of places where we're looking for .Popover class names. Generally speaking, we should avoid querying by class names because changing the class name should not break tests that do not explicitly depend on the class name of the component.

packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/MenuItem/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
packages/react/src/components/Popover/index.test.tsx Outdated Show resolved Hide resolved
@denysfedorov denysfedorov changed the title test: switch popover tests to react testing library test: switch Popover tests to react testing library Jun 17, 2024
Copy link
Member

@scurker scurker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There's still an unresolved convo regarding setting aria-labelledby

@scurker scurker merged commit 8d7039a into develop Jul 2, 2024
8 checks passed
@scurker scurker deleted the tests--popover branch July 2, 2024 18:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants