Skip to content

Commit

Permalink
add test for template only in addon
Browse files Browse the repository at this point in the history
  • Loading branch information
patricklx committed Mar 23, 2024
1 parent 3dad581 commit 001e36a
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions tests/scenarios/vite-app-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,23 @@ viteAppScenarios
});

project.addDevDependency(addon);

let addon2 = baseAddon();
addon2.pkg.name = 'my-addon2';
merge(addon2.files, {
app: {
components: {
'component-two.js': `export { default } from 'my-addon2/components/component-two';`,
},
},
addon: {
components: {
'component-two.hbs': `component two template: "{{this}}"`,
},
},
});

project.addDevDependency(addon2);
project.mergeFiles({
tests: {
integration: {
Expand All @@ -97,9 +114,11 @@ viteAppScenarios
test('should have component one template from addon', async function (assert) {
await render(hbs\`
<ComponentOne></ComponentOne>
<ComponentTwo />
\`);
await rerender();
assert.dom().includesText('component one template');
assert.dom().includesText('component two template: ""');
assert.dom().doesNotIncludeText('export default precompileTemplate');
});
});
Expand Down

0 comments on commit 001e36a

Please sign in to comment.