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

Ensure ember-testing-container is reset properly. #229

Merged
merged 1 commit into from
Oct 20, 2017

Conversation

rwjblue
Copy link
Member

@rwjblue rwjblue commented Oct 20, 2017

The changes made in 7ad93d2 introduced a bug in the way that the testing DOM is cleaned up between tests. The error was quite simple: we were storing the storedValue = container.outerHTML before starting the test then resetting container.innerHTML = storedValue. This created a DOM node leak for each test processed.

This fixes the issue for both the new testing API's in 0.7 and the older pre-existing system. It also adds some post-test checks to ensure that the DOM is indeed what we expect after each test is completed.

Fixes #228.

The changes made in 7ad93d2 introduced a bug in the way that the
testing DOM is cleaned up between tests. The error was quite simple:
we were storing the `storedValue = container.outerHTML` before
starting the test then resetting `container.innerHTML = storedValue`.
This created a DOM node leak for each test processed.

This fixes the issue for both the new testing API's in 0.7 and the
older pre-existing system. It also adds some post-test checks to
ensure that the DOM is indeed what we expect after each test is
completed.
@Turbo87
Copy link
Member

Turbo87 commented Oct 20, 2017

Why exactly do we need two divs?

@Turbo87 Turbo87 added the bug label Oct 20, 2017
@rwjblue
Copy link
Member Author

rwjblue commented Oct 20, 2017

We have had them historically (I believe the container is used for styling the preview window stuff), this library just ignored the fact that we had two which allows this little “trick” (using innerHTML of the container div to ensure the attributes of the ember-testing div are fully reset).

FWIW, in qunit land (not sure how mocha does this) we should probably just embed the container inside the qunit-fixture div and all of this cleanup would be taken care of for us.

@Turbo87 Turbo87 merged commit 2887690 into emberjs:master Oct 20, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

New setupRenderingTest seems to recreate the #ember-testing-container for every test
2 participants