Skip to content

Commit 05b60f0

Browse files
committed
Update the component import path in addon tests
We now use the addon name instead of the modulePrefix.
1 parent 1c3a48f commit 05b60f0

File tree

5 files changed

+5
-4
lines changed

5 files changed

+5
-4
lines changed

blueprints/component-test/files/__root__/__testType__/__path__/__test__.gjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% if (testType === 'integration') { %>import { module, test } from 'qunit';
22
import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import <%= componentName %> from '<%= modulePrefix %>/components/<%= componentPathName %>';
4+
import <%= componentName %> from '<%= pkgName %>/components/<%= componentPathName %>';
55

66
module('<%= friendlyTestDescription %>', function (hooks) {
77
setupRenderingTest(hooks);

blueprints/component-test/files/__root__/__testType__/__path__/__test__.gts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<% if (testType === 'integration') { %>import { module, test } from 'qunit';
22
import { setupRenderingTest } from '<%= modulePrefix %>/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import <%= componentName %> from '<%= modulePrefix %>/components/<%= componentPathName %>';
4+
import <%= componentName %> from '<%= pkgName %>/components/<%= componentPathName %>';
55

66
module('<%= friendlyTestDescription %>', function (hooks) {
77
setupRenderingTest(hooks);

blueprints/component-test/index.js

+1
Original file line numberDiff line numberDiff line change
@@ -129,6 +129,7 @@ module.exports = {
129129
selfCloseComponent,
130130
friendlyTestDescription,
131131
hbsImportStatement,
132+
pkgName: options.project.pkg.name,
132133
};
133134
},
134135

node-tests/fixtures/component-test/addon.gjs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { module, test } from 'qunit';
22
import { setupRenderingTest } from 'dummy/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import Foo from 'dummy/components/foo';
4+
import Foo from 'my-addon/components/foo';
55

66
module('Integration | Component | foo', function (hooks) {
77
setupRenderingTest(hooks);

node-tests/fixtures/component-test/addon.gts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { module, test } from 'qunit';
22
import { setupRenderingTest } from 'dummy/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import Foo from 'dummy/components/foo';
4+
import Foo from 'my-addon/components/foo';
55

66
module('Integration | Component | foo', function (hooks) {
77
setupRenderingTest(hooks);

0 commit comments

Comments
 (0)