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

fix(component-testing): ensure to call unmount after each test #15385

Merged
merged 13 commits into from
Mar 10, 2021

Conversation

lmiller1990
Copy link
Contributor

Closes cypress-io.atlassian.net/browse/CT-318
User facing changelog
N/A

Additional details
We need to unmount the previous node when using Vite or strange things happen. We do this in beforeEach.

How has the user experience changed?
It works properly now.

PR Tasks
N/A

@lmiller1990 lmiller1990 requested a review from elevatebart March 10, 2021 03:31
@cypress-bot
Copy link
Contributor

cypress-bot bot commented Mar 10, 2021

Thanks for taking the time to open a PR!

elevatebart
elevatebart previously approved these changes Mar 10, 2021
Copy link
Contributor

@elevatebart elevatebart left a comment

Choose a reason for hiding this comment

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

Done

@cypress
Copy link

cypress bot commented Mar 10, 2021



Test summary

4534 0 49 2


Run details

Project cypress
Status Passed
Commit 4d28b71
Started Mar 10, 2021 5:31 AM
Ended Mar 10, 2021 5:41 AM
Duration 09:34 💡
OS Linux Debian - 10.5
Browser Multiple

View run in Cypress Dashboard ➡️


This comment has been generated by cypress-bot as a result of this project's GitHub integration settings. You can manage this integration in this project's settings in the Cypress Dashboard

@lmiller1990 lmiller1990 requested a review from elevatebart March 10, 2021 07:25
@brian-mann
Copy link
Member

You would not want to do this in a beforeEach, you'll want to use Cypress's internal events to do this outside of mocha.

@elevatebart elevatebart changed the title fix: ensure to call unmount after each test fix(component-testing): ensure to call unmount after each test Mar 10, 2021
@@ -52,15 +52,13 @@ export const AUT_IFRAME_MARGIN = {

const App: React.FC<AppProps> = observer(
function App (props: AppProps) {
const searchRef = React.createRef<HTMLInputElement>(null)
const searchRef = React.useRef<HTMLInputElement>(null)
Copy link
Contributor

Choose a reason for hiding this comment

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

How are those changes related to this fix?

@lmiller1990 lmiller1990 merged commit 153fc51 into develop Mar 10, 2021
@lmiller1990 lmiller1990 deleted the fix/unmount-after-each-spec-vite branch March 10, 2021 16:07
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.

3 participants