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 default "rootElement" for Ember projects #9

Merged
merged 1 commit into from
Oct 8, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/qunit-dom.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@ import DOMAssertions from './assertions';

QUnit.extend(QUnit.assert, {
dom(target, rootElement) {
return new DOMAssertions(target, rootElement || document, this);
return new DOMAssertions(target, rootElement || this.dom.rootElement || document, this);
}
});
4 changes: 3 additions & 1 deletion tests/acceptance/qunit-dom-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,13 @@ import moduleForAcceptance from '../../tests/helpers/module-for-acceptance';
moduleForAcceptance('Acceptance | qunit-dom');

test('qunit-dom assertions are available', function(assert) {
assert.expect(5);
assert.expect(6);

assert.ok(assert.dom, 'assert.dom is available');
assert.ok(assert.dom('.foo').textContains, 'assert.dom(...).textContains is available');

assert.dom('#qunit').missing('rootElement is set to #ember-testing-container');

visit('/');
andThen(() => {
assert.dom('#title').exists();
Expand Down