Skip to content

Commit

Permalink
Fix default "rootElement" for Ember projects
Browse files Browse the repository at this point in the history
  • Loading branch information
Turbo87 committed Oct 8, 2017
1 parent 2ec7ce4 commit 20e68b6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
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

0 comments on commit 20e68b6

Please sign in to comment.