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

Use mount/unmountAll from @hypothesis/frontend-testing #6872

Merged
merged 2 commits into from
Nov 27, 2024

Conversation

robertknight
Copy link
Member

This is the same change as hypothesis/client#6693, but for this project.

Unmount components mounted via `mount` from `@hypothesis/frontend-testing` after
each test has run.
Replace calls to `mount` from enzyme with `mount` from
@hypothesis/frontend-testing. This reduces the boilerplate for creating DOM
containers and unmounting components.
Copy link
Contributor

@acelaya acelaya left a comment

Choose a reason for hiding this comment

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

👍🏼

@@ -7,6 +8,9 @@ sinon.assert.expose(assert, { prefix: null });

// Configure Enzyme for UI tests.
configure({ adapter: new Adapter() });
afterEach(() => {
unmountAll();
});
Copy link
Contributor

Choose a reason for hiding this comment

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

Not sure if we have a tests bootstrap/init/set-up script in other projects, but if we do, we should do this in all of them, so that we don't have to remember unmounting every time.

Copy link
Member Author

Choose a reason for hiding this comment

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

I believe we have a bootstrap.js file in every project to set up Sinon, asserts, the Enzyme adapter etc.

@robertknight robertknight merged commit 80aabd0 into main Nov 27, 2024
9 checks passed
@robertknight robertknight deleted the use-mount-unmount-all branch November 27, 2024 08:30
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