@@ -271,6 +271,12 @@ describe('Blueprint: component', function () {
271
271
}
272
272
) ;
273
273
} ) ;
274
+ } ) ;
275
+
276
+ describe ( 'in app (default test setup)' , function ( ) {
277
+ beforeEach ( function ( ) {
278
+ return emberNew ( ) ;
279
+ } ) ;
274
280
275
281
it ( 'component foo --strict' , function ( ) {
276
282
return emberGenerateDestroy ( [ 'component' , 'foo' , '--strict' ] , ( _file ) => {
@@ -410,6 +416,64 @@ describe('Blueprint: component', function () {
410
416
} ) ;
411
417
} ) ;
412
418
419
+ it ( 'component foo/x-foo' , function ( ) {
420
+ return emberGenerateDestroy ( [ 'component' , 'foo/x-foo' ] , ( _file ) => {
421
+ expect ( _file ( 'addon/components/foo/x-foo.js' ) ) . to . not . exist ;
422
+
423
+ expect ( _file ( 'addon/components/foo/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
424
+
425
+ expect ( _file ( 'app/components/foo/x-foo.js' ) ) . to . contain (
426
+ "export { default } from 'my-addon/components/foo/x-foo';"
427
+ ) ;
428
+
429
+ expect ( _file ( 'app/templates/components/foo/x-foo.js' ) ) . to . not . exist ;
430
+
431
+ expect ( _file ( 'tests/integration/components/foo/x-foo-test.js' ) ) . to . equal (
432
+ fixture ( 'component-test/default-template.js' , {
433
+ replace : {
434
+ component : 'foo/x-foo' ,
435
+ componentInvocation : 'Foo::XFoo' ,
436
+ } ,
437
+ } )
438
+ ) ;
439
+ } ) ;
440
+ } ) ;
441
+
442
+ it ( 'component x-foo --dummy' , function ( ) {
443
+ return emberGenerateDestroy ( [ 'component' , 'x-foo' , '--dummy' ] , ( _file ) => {
444
+ expect ( _file ( 'tests/dummy/app/components/x-foo.js' ) ) . to . not . exist ;
445
+
446
+ expect ( _file ( 'tests/dummy/app/components/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
447
+
448
+ expect ( _file ( 'app/components/x-foo.js' ) ) . to . not . exist ;
449
+ expect ( _file ( 'app/components/x-foo.hbs' ) ) . to . not . exist ;
450
+ expect ( _file ( 'app/templates/components/x-foo.js' ) ) . to . not . exist ;
451
+
452
+ expect ( _file ( 'tests/integration/components/x-foo-test.js' ) ) . to . not . exist ;
453
+ } ) ;
454
+ } ) ;
455
+
456
+ it ( 'component foo/x-foo --dummy' , function ( ) {
457
+ return emberGenerateDestroy ( [ 'component' , 'foo/x-foo' , '--dummy' ] , ( _file ) => {
458
+ expect ( _file ( 'tests/dummy/app/components/foo/x-foo.js' ) ) . to . not . exist ;
459
+
460
+ expect ( _file ( 'tests/dummy/app/components/foo/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
461
+ expect ( _file ( 'tests/dummy/app/templates/components/foo/x-foo.hbs' ) ) . to . not . exist ;
462
+
463
+ expect ( _file ( 'app/components/foo/x-foo.js' ) ) . to . not . exist ;
464
+ expect ( _file ( 'app/components/foo/x-foo.hbs' ) ) . to . not . exist ;
465
+ expect ( _file ( 'app/templates/components/foo/x-foo.js' ) ) . to . not . exist ;
466
+
467
+ expect ( _file ( 'tests/integration/components/foo/x-foo-test.js' ) ) . to . not . exist ;
468
+ } ) ;
469
+ } ) ;
470
+ } ) ;
471
+
472
+ describe ( 'in addon (default test setup)' , function ( ) {
473
+ beforeEach ( function ( ) {
474
+ return emberNew ( { target : 'addon' } ) ;
475
+ } ) ;
476
+
413
477
it ( 'component foo --strict' , function ( ) {
414
478
return emberGenerateDestroy ( [ 'component' , 'foo' , '--strict' ] , ( _file ) => {
415
479
expect ( _file ( 'addon/components/foo.js' ) ) . to . not . exist ;
@@ -466,58 +530,6 @@ describe('Blueprint: component', function () {
466
530
}
467
531
) ;
468
532
} ) ;
469
-
470
- it ( 'component foo/x-foo' , function ( ) {
471
- return emberGenerateDestroy ( [ 'component' , 'foo/x-foo' ] , ( _file ) => {
472
- expect ( _file ( 'addon/components/foo/x-foo.js' ) ) . to . not . exist ;
473
-
474
- expect ( _file ( 'addon/components/foo/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
475
-
476
- expect ( _file ( 'app/components/foo/x-foo.js' ) ) . to . contain (
477
- "export { default } from 'my-addon/components/foo/x-foo';"
478
- ) ;
479
-
480
- expect ( _file ( 'app/templates/components/foo/x-foo.js' ) ) . to . not . exist ;
481
-
482
- expect ( _file ( 'tests/integration/components/foo/x-foo-test.js' ) ) . to . equal (
483
- fixture ( 'component-test/default-template.js' , {
484
- replace : {
485
- component : 'foo/x-foo' ,
486
- componentInvocation : 'Foo::XFoo' ,
487
- } ,
488
- } )
489
- ) ;
490
- } ) ;
491
- } ) ;
492
-
493
- it ( 'component x-foo --dummy' , function ( ) {
494
- return emberGenerateDestroy ( [ 'component' , 'x-foo' , '--dummy' ] , ( _file ) => {
495
- expect ( _file ( 'tests/dummy/app/components/x-foo.js' ) ) . to . not . exist ;
496
-
497
- expect ( _file ( 'tests/dummy/app/components/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
498
-
499
- expect ( _file ( 'app/components/x-foo.js' ) ) . to . not . exist ;
500
- expect ( _file ( 'app/components/x-foo.hbs' ) ) . to . not . exist ;
501
- expect ( _file ( 'app/templates/components/x-foo.js' ) ) . to . not . exist ;
502
-
503
- expect ( _file ( 'tests/integration/components/x-foo-test.js' ) ) . to . not . exist ;
504
- } ) ;
505
- } ) ;
506
-
507
- it ( 'component foo/x-foo --dummy' , function ( ) {
508
- return emberGenerateDestroy ( [ 'component' , 'foo/x-foo' , '--dummy' ] , ( _file ) => {
509
- expect ( _file ( 'tests/dummy/app/components/foo/x-foo.js' ) ) . to . not . exist ;
510
-
511
- expect ( _file ( 'tests/dummy/app/components/foo/x-foo.hbs' ) ) . to . equal ( '{{yield}}' ) ;
512
- expect ( _file ( 'tests/dummy/app/templates/components/foo/x-foo.hbs' ) ) . to . not . exist ;
513
-
514
- expect ( _file ( 'app/components/foo/x-foo.js' ) ) . to . not . exist ;
515
- expect ( _file ( 'app/components/foo/x-foo.hbs' ) ) . to . not . exist ;
516
- expect ( _file ( 'app/templates/components/foo/x-foo.js' ) ) . to . not . exist ;
517
-
518
- expect ( _file ( 'tests/integration/components/foo/x-foo-test.js' ) ) . to . not . exist ;
519
- } ) ;
520
- } ) ;
521
533
} ) ;
522
534
523
535
describe ( 'in in-repo-addon' , function ( ) {
0 commit comments