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

Reset ember-testing div to initial state on teardown #180

Merged
merged 1 commit into from
Sep 27, 2016

Conversation

trentmwillis
Copy link
Member

Addresses #178

Copy link
Member

@rwjblue rwjblue left a comment

Choose a reason for hiding this comment

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

Generally, looks good.

I see the test that ensures the fixture contents are reset (which AFAICT would have passed before these changes), but I'd like to have a test that ensures the fixture contents are not wiped between tests (to ensure that your actual desired scenario works). Can you add a test for that?

let element = document.createElement('div');
element.setAttribute('id', 'ember-testing');

document.body.appendChild(element);
this.fixture = '';
} else {
this.fixture = testEl.innerHTML;
Copy link
Member

Choose a reason for hiding this comment

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

Can you change this to this.fixtureResetValue, and initialize it in the constructor?

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 can change the name. For initialization, I originally tried it in the constructor, but test-module overrides init and doesn't call _super so it never gets set in that scenario. I could add it in both locations, but I figured this was cleaner. Does cause the shape to morph, but figured since this was just a testing environment that it's not a huge deal.

@rwjblue
Copy link
Member

rwjblue commented Sep 22, 2016

@trentmwillis - ping?

@trentmwillis
Copy link
Member Author

Sorry @rwjblue got pulled into a bunch of Engines work, will try to wrap this up today.

@trentmwillis
Copy link
Member Author

@rwjblue changed the property name and added another test (was a pain to figure out how to test it).

@sangm
Copy link

sangm commented Sep 27, 2016

@rwjblue any updates on this?

@rwjblue rwjblue merged commit c392d85 into emberjs:master Sep 27, 2016
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