Skip to content

Commit 77f8070

Browse files
committed
Add some more tests
1 parent a460c38 commit 77f8070

File tree

1 file changed

+90
-0
lines changed

1 file changed

+90
-0
lines changed

node-tests/blueprints/component-test.js

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -277,6 +277,14 @@ describe('Blueprint: component', function () {
277277
expect(_file('app/components/foo.gjs')).to.equal(
278278
fixture('component/template-only-component.gjs')
279279
);
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+
);
280288
});
281289
});
282290

@@ -287,6 +295,14 @@ describe('Blueprint: component', function () {
287295
expect(_file('app/components/foo.gjs')).to.equal(
288296
fixture('component/glimmer-component.gjs')
289297
);
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+
);
290306
}
291307
);
292308
});
@@ -304,6 +320,14 @@ describe('Blueprint: component', function () {
304320
expect(_file('app/components/foo.gts')).to.equal(
305321
fixture('component/template-only-component.gts')
306322
);
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+
);
307331
});
308332
});
309333

@@ -314,6 +338,14 @@ describe('Blueprint: component', function () {
314338
expect(_file('app/components/foo.gts')).to.equal(
315339
fixture('component/glimmer-component.gts')
316340
);
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+
);
317349
}
318350
);
319351
});
@@ -378,6 +410,64 @@ describe('Blueprint: component', function () {
378410
});
379411
});
380412

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+
381471
it('component foo/x-foo', function () {
382472
return emberGenerateDestroy(['component', 'foo/x-foo'], (_file) => {
383473
expect(_file('addon/components/foo/x-foo.js')).to.not.exist;

0 commit comments

Comments
 (0)