@@ -15,7 +15,6 @@ import {
15
15
} from '@ember/test-helpers' ;
16
16
import templateOnly from '@ember/component/template-only' ;
17
17
18
- import hasEmberVersion from '@ember/test-helpers/has-ember-version' ;
19
18
import { setResolverRegistry } from '../helpers/resolver' ;
20
19
import { hbs } from 'ember-cli-htmlbars' ;
21
20
import { precompileTemplate } from '@ember/template-compilation' ;
@@ -143,60 +142,56 @@ module('setupRenderingContext "real world"', function (hooks) {
143
142
} ) ;
144
143
145
144
module ( 'lexical scope access' , function ( ) {
146
- if ( hasEmberVersion ( 3 , 28 ) ) {
147
- test ( 'can render components passed as locals' , async function ( assert ) {
148
- let add = helper ( function ( [ first , second ] ) {
149
- return first + second ;
150
- } ) ;
151
-
152
- await render (
153
- precompileTemplate ( '{{add 1 3}}' , {
154
- scope ( ) {
155
- return { add } ;
156
- } ,
157
- } )
158
- ) ;
159
-
160
- assert . equal ( this . element . textContent , '4' ) ;
145
+ test ( 'can render components passed as locals' , async function ( assert ) {
146
+ let add = helper ( function ( [ first , second ] ) {
147
+ return first + second ;
161
148
} ) ;
162
- }
149
+
150
+ await render (
151
+ precompileTemplate ( '{{add 1 3}}' , {
152
+ scope ( ) {
153
+ return { add } ;
154
+ } ,
155
+ } )
156
+ ) ;
157
+
158
+ assert . equal ( this . element . textContent , '4' ) ;
159
+ } ) ;
163
160
} ) ;
164
161
165
162
module ( 'render with a component' , function ( ) {
166
- if ( hasEmberVersion ( 3 , 25 ) ) {
167
- test ( 'can render locally defined components' , async function ( assert ) {
168
- class MyComponent extends GlimmerComponent { }
163
+ test ( 'can render locally defined components' , async function ( assert ) {
164
+ class MyComponent extends GlimmerComponent { }
169
165
170
- setComponentTemplate ( hbs `my name is {{@name}}` , MyComponent ) ;
166
+ setComponentTemplate ( hbs `my name is {{@name}}` , MyComponent ) ;
171
167
172
- const somePerson = new ( class {
173
- @tracked name = 'Zoey' ;
174
- } ) ( ) ;
168
+ const somePerson = new ( class {
169
+ @tracked name = 'Zoey' ;
170
+ } ) ( ) ;
175
171
176
- const template = precompileTemplate (
177
- '<MyComponent @name={{somePerson.name}} />' ,
178
- {
179
- scope ( ) {
180
- return {
181
- somePerson,
182
- MyComponent,
183
- } ;
184
- } ,
185
- }
186
- ) ;
172
+ const template = precompileTemplate (
173
+ '<MyComponent @name={{somePerson.name}} />' ,
174
+ {
175
+ scope ( ) {
176
+ return {
177
+ somePerson,
178
+ MyComponent,
179
+ } ;
180
+ } ,
181
+ }
182
+ ) ;
187
183
188
- const component = setComponentTemplate ( template , templateOnly ( ) ) ;
184
+ const component = setComponentTemplate ( template , templateOnly ( ) ) ;
189
185
190
- await render ( component ) ;
186
+ await render ( component ) ;
191
187
192
- assert . equal ( this . element . textContent , 'my name is Zoey' ) ;
188
+ assert . equal ( this . element . textContent , 'my name is Zoey' ) ;
193
189
194
- somePerson . name = 'Tomster' ;
190
+ somePerson . name = 'Tomster' ;
195
191
196
- await rerender ( ) ;
192
+ await rerender ( ) ;
197
193
198
- assert . equal ( this . element . textContent , 'my name is Tomster' ) ;
199
- } ) ;
200
- }
194
+ assert . equal ( this . element . textContent , 'my name is Tomster' ) ;
195
+ } ) ;
201
196
} ) ;
202
197
} ) ;
0 commit comments