From 20e68b6285b4a8e891c77c27987105828f06ef62 Mon Sep 17 00:00:00 2001 From: Tobias Bieniek Date: Sun, 8 Oct 2017 13:01:53 +0200 Subject: [PATCH] Fix default "rootElement" for Ember projects --- lib/qunit-dom.js | 2 +- tests/acceptance/qunit-dom-test.js | 4 +++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/lib/qunit-dom.js b/lib/qunit-dom.js index 909afea49..60e00185e 100644 --- a/lib/qunit-dom.js +++ b/lib/qunit-dom.js @@ -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); } }); diff --git a/tests/acceptance/qunit-dom-test.js b/tests/acceptance/qunit-dom-test.js index f2157a23c..8e45ec37c 100644 --- a/tests/acceptance/qunit-dom-test.js +++ b/tests/acceptance/qunit-dom-test.js @@ -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();