1
1
/* eslint-disable ember/no-classic-components */
2
2
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' ;
4
5
import { helper } from '@ember/component/helper' ;
5
6
import { hbs } from 'ember-cli-htmlbars' ;
6
7
import { setupRenderingTest } from 'ember-qunit' ;
7
8
import { render } from '@ember/test-helpers' ;
9
+ import { macroCondition , dependencySatisfies } from '@embroider/macros' ;
8
10
9
11
module ( 'setupRenderingTest tests' , function ( hooks ) {
10
12
setupRenderingTest ( hooks ) ;
@@ -16,10 +18,20 @@ module('setupRenderingTest tests', function (hooks) {
16
18
} ) ;
17
19
18
20
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
+
23
35
await render ( hbs `<TemplateOnly />` ) ;
24
36
25
37
assert . strictEqual (
0 commit comments