Skip to content

Commit bb09cb7

Browse files
Merge pull request #1179 from emberjs/fix-canary-tests
Fix tests on ember v6+
2 parents dafee6b + 5c2a131 commit bb09cb7

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

test-app/tests/integration/setup-rendering-test-test.js

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,12 @@
11
/* eslint-disable ember/no-classic-components */
22
import { module, test } from 'qunit';
3-
import Component from '@ember/component';
3+
import Component, { setComponentTemplate } from '@ember/component';
4+
import templateOnly from '@ember/component/template-only';
45
import { helper } from '@ember/component/helper';
56
import { hbs } from 'ember-cli-htmlbars';
67
import { setupRenderingTest } from 'ember-qunit';
78
import { render } from '@ember/test-helpers';
9+
import { macroCondition, dependencySatisfies } from '@embroider/macros';
810

911
module('setupRenderingTest tests', function (hooks) {
1012
setupRenderingTest(hooks);
@@ -16,10 +18,20 @@ module('setupRenderingTest tests', function (hooks) {
1618
});
1719

1820
test('can invoke template only components', async function (assert) {
19-
this.owner.register(
20-
'template:components/template-only',
21-
hbs`template-only component here`
22-
);
21+
if (
22+
macroCondition(dependencySatisfies('ember-source', '>= 6.0.0-alpha.0'))
23+
) {
24+
this.owner.register(
25+
'component:template-only',
26+
setComponentTemplate(hbs`template-only component here`, templateOnly())
27+
);
28+
} else {
29+
this.owner.register(
30+
'template:components/template-only',
31+
hbs`template-only component here`
32+
);
33+
}
34+
2335
await render(hbs`<TemplateOnly />`);
2436

2537
assert.strictEqual(

0 commit comments

Comments
 (0)