@@ -186,6 +186,62 @@ describe('ColocatedTemplateCompiler', function () {
186
186
) ;
187
187
} ) ;
188
188
189
+ it ( 'works for re-exported component with a template' , async function ( ) {
190
+ input . write ( {
191
+ 'app-name-here' : {
192
+ 'router.js' : '// stuff here' ,
193
+ components : {
194
+ 'foo.hbs' : `{{yield}}` ,
195
+ 'foo.js' : `export { default } from 'some-place';` ,
196
+ } ,
197
+ templates : {
198
+ 'application.hbs' : `{{outlet}}` ,
199
+ } ,
200
+ } ,
201
+ } ) ;
202
+
203
+ let tree = new ColocatedTemplateCompiler ( input . path ( ) ) ;
204
+
205
+ output = createBuilder ( tree ) ;
206
+ await output . build ( ) ;
207
+
208
+ assert . deepStrictEqual ( output . read ( ) , {
209
+ 'app-name-here' : {
210
+ 'router.js' : '// stuff here' ,
211
+ components : {
212
+ 'foo.js' : stripIndent `
213
+ import { hbs } from 'ember-cli-htmlbars';
214
+ const __COLOCATED_TEMPLATE__ = hbs("{{yield}}", {"contents":"{{yield}}","moduleName":"app-name-here/components/foo.hbs","parseOptions":{"srcName":"app-name-here/components/foo.hbs"}});
215
+ import Component from 'some-place';
216
+
217
+ export default class extends Component {}
218
+ ` ,
219
+ } ,
220
+ templates : {
221
+ 'application.hbs' : '{{outlet}}' ,
222
+ } ,
223
+ } ,
224
+ } ) ;
225
+
226
+ await output . build ( ) ;
227
+
228
+ assert . deepStrictEqual ( output . changes ( ) , { } , 'NOOP update has no changes' ) ;
229
+
230
+ input . write ( {
231
+ 'app-name-here' : {
232
+ 'router.js' : '// other stuff here' ,
233
+ } ,
234
+ } ) ;
235
+
236
+ await output . build ( ) ;
237
+
238
+ assert . deepStrictEqual (
239
+ output . changes ( ) ,
240
+ { 'app-name-here/router.js' : 'change' } ,
241
+ 'has only related changes'
242
+ ) ;
243
+ } ) ;
244
+
189
245
it ( 'works for typescript component class with template' , async function ( ) {
190
246
input . write ( {
191
247
'app-name-here' : {
0 commit comments