Add test container option #168

Merged
merged 5 commits into from Apr 23, 2016

Projects

None yet

2 participants

@san650
Owner
san650 commented Apr 23, 2016

Add support for targeting elements outside ember application container. Useful for testing components that append elements to the body in tests.

var page = create({
  title: text('h1', { testContainer: 'body' })
});

assert.equal(page.title, 'foo');

This PR adds this option to every property for acceptance and component integration tests

added some commits Apr 23, 2016
@san650 Simplify component integration tests fadccea
@san650 Move integrations tests 6d77c9f
@san650 Simplify clickOnText property 8137633
@san650 Add `testContainer` option 8e3a099
@san650 Add `testContainer` support in integration tests
84fb925
@san650
Owner
san650 commented Apr 23, 2016
@jeradg
Collaborator
jeradg commented Apr 23, 2016

@san650: This is a great idea!

One question: What's the reasoning for deleting those two integration tests? I'm worried that we now don't have test coverage ensuring that page objects will work correctly with component tests.

@san650
Owner
san650 commented Apr 23, 2016

@jeradg I didn't take a deep look at those tests but my impression was that those two integration tests weren't testing anything new (i.e. the other integration tests cover the same cases).

If some tests cases are missing I can add those to the "calculator" tests.

@jeradg
Collaborator
jeradg commented Apr 23, 2016

@san650: As long as we have coverage of all of the properties/actions for components, it doesn't matter to me where they are. I originally copied the acceptance tests and reworked them into component tests. Makes sense to me that we would have the same coverage in both contexts.

@san650
Owner
san650 commented Apr 23, 2016

I'll take a closer look at these tests and ensure we're not losing coverage. Thanks for the heads up!

@san650
Owner
san650 commented Apr 23, 2016

@jeradg I've just checked the tests and I'm pretty sure all cases that were tested on the deleted tests are also covered in the existent ones.

Let me know if there's any change you would like to make to this PR.

@san650 san650 added the enhancement label Apr 23, 2016
@jeradg
Collaborator
jeradg commented Apr 23, 2016

@san650: Looks good to me. Look forward to trying it out.

@san650
Owner
san650 commented Apr 23, 2016

@jeradg please merge it. Let's ignore the Codacy issue for now 😛

@jeradg
Collaborator
jeradg commented Apr 23, 2016

Yeah, Codacy is being completely useless lately.

@jeradg jeradg merged commit 81f4852 into master Apr 23, 2016

2 of 3 checks passed

codacy/pr Not so good... This pull request quality could be better.
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
continuous-integration/travis-ci/push The Travis CI build passed
Details
@san650 san650 deleted the test-container-option branch Apr 23, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment