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

#2168: Added unit tests to check proper component unmounting #2195

Merged
merged 4 commits into from
Jan 17, 2020
Merged

#2168: Added unit tests to check proper component unmounting #2195

merged 4 commits into from
Jan 17, 2020

Conversation

timon-witt
Copy link
Contributor

I added two tests that show the bug: #2168

@coveralls
Copy link

coveralls commented Dec 19, 2019

Coverage Status

Coverage remained the same at 97.747% when pulling 44c3581 on timon-witt:#2168-unmount-children into 25fee1c on preactjs:master.

}
}

// The only difference to the previous test is the extra div here
Copy link
Member

@JoviDeCroock JoviDeCroock Dec 19, 2019

Choose a reason for hiding this comment

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

Yes but this <div> is not part of your vnode tree since you start underneath and then target it with newScratch.firstElementChild did this work with Preact 8? This isn't supported in Preact X atleast since this falls outside your render root.

<scratch>
  <div> <-- you start replacing node here
    <div id="child"> <-- your root starts here
</scratch>

^ this is intended

@JoviDeCroock
Copy link
Member

I don't mind merging in the first test, the second has been discussed on your issue right? Do you think we could do more to help out in this case?

@timon-witt
Copy link
Contributor Author

Yes, the issue has been discussed and there is a reasonable workaround for now. Keeping the first test would still be great like you said. Thank's for the support!

Copy link
Member

@JoviDeCroock JoviDeCroock left a comment

Choose a reason for hiding this comment

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

Thanks for this, more tests prevents us from accidentally shipping regressions!

@JoviDeCroock JoviDeCroock merged commit 6771b23 into preactjs:master Jan 17, 2020
@pika-ci
Copy link

pika-ci bot commented Jan 17, 2020

🚀 This PR has been merged! Once a new release is created, any changes will become available on npm. Until then, you can load and install it directly from the Pika CDN:

npm install https://cdn.pika.dev/preact/master

porfirioribeiro pushed a commit to porfirioribeiro/preact that referenced this pull request Feb 3, 2020
…reactjs#2195)

* preactjs#2168: Added unit tests to check proper component unmounting

* preactjs#2168: Remove test onlies

* remove the second test (invalid)

Co-authored-by: Jovi De Croock <decroockjovi@gmail.com>
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