Skip to content

Commit e0e7179

Browse files
committed
tests/helpers: Use app-test data attribute instead of CSS class
1 parent 0fef2f4 commit e0e7179

File tree

2 files changed

+5
-8
lines changed

2 files changed

+5
-8
lines changed

tests/helpers/index.js

+4-7
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,15 @@ export function setupApplicationTest(hooks, options) {
1010
upstreamSetupApplicationTest(hooks, options);
1111
setupMirage(hooks);
1212
setupSentryMock(hooks);
13-
setupAppTestBodyClass(hooks);
13+
setupAppTestDataAttr(hooks);
1414
}
1515

16-
function setupAppTestBodyClass(hooks) {
17-
const ID = 'app-test';
18-
16+
function setupAppTestDataAttr(hooks) {
1917
hooks.beforeEach(function () {
20-
this.bodyClass = this.owner.lookup('service:body-class');
21-
this.bodyClass.register(ID, ['app-test']);
18+
document.documentElement.dataset.appTest = '';
2219
});
2320

2421
hooks.afterEach(function () {
25-
this.bodyClass.deregister(ID);
22+
delete document.documentElement.dataset.appTest;
2623
});
2724
}

vendor/qunit.css

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
body.app-test .ember-application {
1+
[data-app-test] .ember-application {
22
background-color: var(--header-bg-color);
33
}

0 commit comments

Comments
 (0)