@@ -277,6 +277,14 @@ describe('Blueprint: component', function () {
277
277
expect ( _file ( 'app/components/foo.gjs' ) ) . to . equal (
278
278
fixture ( 'component/template-only-component.gjs' )
279
279
) ;
280
+
281
+ expect ( _file ( 'tests/integration/components/foo-test.gjs' ) ) . to . equal (
282
+ fixture ( 'component-test/rfc232.gjs' , {
283
+ replace : {
284
+ modulePrefix : 'my-app' ,
285
+ } ,
286
+ } )
287
+ ) ;
280
288
} ) ;
281
289
} ) ;
282
290
@@ -287,6 +295,14 @@ describe('Blueprint: component', function () {
287
295
expect ( _file ( 'app/components/foo.gjs' ) ) . to . equal (
288
296
fixture ( 'component/glimmer-component.gjs' )
289
297
) ;
298
+
299
+ expect ( _file ( 'tests/integration/components/foo-test.gjs' ) ) . to . equal (
300
+ fixture ( 'component-test/rfc232.gjs' , {
301
+ replace : {
302
+ modulePrefix : 'my-app' ,
303
+ } ,
304
+ } )
305
+ ) ;
290
306
}
291
307
) ;
292
308
} ) ;
@@ -304,6 +320,14 @@ describe('Blueprint: component', function () {
304
320
expect ( _file ( 'app/components/foo.gts' ) ) . to . equal (
305
321
fixture ( 'component/template-only-component.gts' )
306
322
) ;
323
+
324
+ expect ( _file ( 'tests/integration/components/foo-test.gts' ) ) . to . equal (
325
+ fixture ( 'component-test/rfc232.gts' , {
326
+ replace : {
327
+ modulePrefix : 'my-app' ,
328
+ } ,
329
+ } )
330
+ ) ;
307
331
} ) ;
308
332
} ) ;
309
333
@@ -314,6 +338,14 @@ describe('Blueprint: component', function () {
314
338
expect ( _file ( 'app/components/foo.gts' ) ) . to . equal (
315
339
fixture ( 'component/glimmer-component.gts' )
316
340
) ;
341
+
342
+ expect ( _file ( 'tests/integration/components/foo-test.gts' ) ) . to . equal (
343
+ fixture ( 'component-test/rfc232.gts' , {
344
+ replace : {
345
+ modulePrefix : 'my-app' ,
346
+ } ,
347
+ } )
348
+ ) ;
317
349
}
318
350
) ;
319
351
} ) ;
@@ -378,6 +410,64 @@ describe('Blueprint: component', function () {
378
410
} ) ;
379
411
} ) ;
380
412
413
+
414
+ it ( 'component foo --strict' , function ( ) {
415
+ return emberGenerateDestroy ( [ 'component' , 'foo' , '--strict' ] , ( _file ) => {
416
+ expect ( _file ( 'addon/components/foo.js' ) ) . to . not . exist ;
417
+ expect ( _file ( 'addon/components/foo.gjs' ) ) . to . equal (
418
+ fixture ( 'component/template-only-component.gjs' )
419
+ ) ;
420
+
421
+ expect ( _file ( 'app/components/foo.js' ) ) . to . contain (
422
+ "export { default } from 'my-addon/components/foo';"
423
+ ) ;
424
+ } ) ;
425
+ } ) ;
426
+
427
+ it ( 'component foo --strict --component-class=@glimmer/component' , function ( ) {
428
+ return emberGenerateDestroy (
429
+ [ 'component' , 'foo' , '--strict' , '--component-class=@glimmer/component' ] ,
430
+ ( _file ) => {
431
+ expect ( _file ( 'addon/components/foo.js' ) ) . to . not . exist ;
432
+ expect ( _file ( 'addon/components/foo.gjs' ) ) . to . equal (
433
+ fixture ( 'component/glimmer-component.gjs' )
434
+ ) ;
435
+
436
+ expect ( _file ( 'app/components/foo.js' ) ) . to . contain (
437
+ "export { default } from 'my-addon/components/foo';"
438
+ ) ;
439
+ }
440
+ ) ;
441
+ } ) ;
442
+
443
+ it ( 'component foo --strict --typescript' , function ( ) {
444
+ return emberGenerateDestroy ( [ 'component' , 'foo' , '--strict' , '--typescript' ] , ( _file ) => {
445
+ expect ( _file ( 'addon/components/foo.ts' ) ) . to . not . exist ;
446
+ expect ( _file ( 'addon/components/foo.gts' ) ) . to . equal (
447
+ fixture ( 'component/template-only-component.gts' )
448
+ ) ;
449
+
450
+ expect ( _file ( 'app/components/foo.js' ) ) . to . contain (
451
+ "export { default } from 'my-addon/components/foo';"
452
+ ) ;
453
+ } ) ;
454
+ } ) ;
455
+
456
+ it ( 'component foo --strict --component-class=@glimmer/component --typescript' , function ( ) {
457
+ return emberGenerateDestroy (
458
+ [ 'component' , 'foo' , '--strict' , '--component-class=@glimmer/component' , '--typescript' ] ,
459
+ ( _file ) => {
460
+ expect ( _file ( 'addon/components/foo.gts' ) ) . to . equal (
461
+ fixture ( 'component/glimmer-component.gts' )
462
+ ) ;
463
+
464
+ expect ( _file ( 'app/components/foo.js' ) ) . to . contain (
465
+ "export { default } from 'my-addon/components/foo';"
466
+ ) ;
467
+ }
468
+ ) ;
469
+ } ) ;
470
+
381
471
it ( 'component foo/x-foo' , function ( ) {
382
472
return emberGenerateDestroy ( [ 'component' , 'foo/x-foo' ] , ( _file ) => {
383
473
expect ( _file ( 'addon/components/foo/x-foo.js' ) ) . to . not . exist ;
0 commit comments