Skip to content

Commit 1c3a48f

Browse files
committed
rename the fixtures
This is in line with the PR that cleans up ember-cli-qunit tests
1 parent 3d1d21e commit 1c3a48f

File tree

6 files changed

+68
-44
lines changed

6 files changed

+68
-44
lines changed

node-tests/blueprints/component-test-test.js

+4-20
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ describe('Blueprint: component-test', function () {
3333
it('component-test foo --strict', function () {
3434
return emberGenerateDestroy(['component-test', 'foo', '--strict'], (_file) => {
3535
expect(_file('tests/integration/components/foo-test.gjs')).to.equal(
36-
fixture('component-test/rfc232.gjs', {
37-
replace: {
38-
modulePrefix: 'my-app',
39-
},
40-
})
36+
fixture('component-test/app.gjs')
4137
);
4238
});
4339
});
@@ -47,11 +43,7 @@ describe('Blueprint: component-test', function () {
4743
['component-test', 'foo', '--strict', '--typescript'],
4844
(_file) => {
4945
expect(_file('tests/integration/components/foo-test.gts')).to.equal(
50-
fixture('component-test/rfc232.gts', {
51-
replace: {
52-
modulePrefix: 'my-app',
53-
},
54-
})
46+
fixture('component-test/app.gts')
5547
);
5648
}
5749
);
@@ -95,11 +87,7 @@ describe('Blueprint: component-test', function () {
9587
it('component-test foo --strict', function () {
9688
return emberGenerateDestroy(['component-test', 'foo', '--strict'], (_file) => {
9789
expect(_file('tests/integration/components/foo-test.gjs')).to.equal(
98-
fixture('component-test/rfc232.gjs', {
99-
replace: {
100-
modulePrefix: 'dummy',
101-
},
102-
})
90+
fixture('component-test/addon.gjs')
10391
);
10492
});
10593
});
@@ -109,11 +97,7 @@ describe('Blueprint: component-test', function () {
10997
['component-test', 'foo', '--strict', '--typescript'],
11098
(_file) => {
11199
expect(_file('tests/integration/components/foo-test.gts')).to.equal(
112-
fixture('component-test/rfc232.gts', {
113-
replace: {
114-
modulePrefix: 'dummy',
115-
},
116-
})
100+
fixture('component-test/addon.gts')
117101
);
118102
}
119103
);

node-tests/blueprints/component-test.js

+4-20
Original file line numberDiff line numberDiff line change
@@ -270,11 +270,7 @@ describe('Blueprint: component', function () {
270270
);
271271

272272
expect(_file('tests/integration/components/foo-test.gjs')).to.equal(
273-
fixture('component-test/rfc232.gjs', {
274-
replace: {
275-
modulePrefix: 'my-app',
276-
},
277-
})
273+
fixture('component-test/app.gjs')
278274
);
279275
});
280276
});
@@ -288,11 +284,7 @@ describe('Blueprint: component', function () {
288284
);
289285

290286
expect(_file('tests/integration/components/foo-test.gjs')).to.equal(
291-
fixture('component-test/rfc232.gjs', {
292-
replace: {
293-
modulePrefix: 'my-app',
294-
},
295-
})
287+
fixture('component-test/app.gjs')
296288
);
297289
}
298290
);
@@ -313,11 +305,7 @@ describe('Blueprint: component', function () {
313305
);
314306

315307
expect(_file('tests/integration/components/foo-test.gts')).to.equal(
316-
fixture('component-test/rfc232.gts', {
317-
replace: {
318-
modulePrefix: 'my-app',
319-
},
320-
})
308+
fixture('component-test/app.gts')
321309
);
322310
});
323311
});
@@ -331,11 +319,7 @@ describe('Blueprint: component', function () {
331319
);
332320

333321
expect(_file('tests/integration/components/foo-test.gts')).to.equal(
334-
fixture('component-test/rfc232.gts', {
335-
replace: {
336-
modulePrefix: 'my-app',
337-
},
338-
})
322+
fixture('component-test/app.gts')
339323
);
340324
}
341325
);

node-tests/fixtures/component-test/rfc232.gjs renamed to node-tests/fixtures/component-test/addon.gjs

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { module, test } from 'qunit';
2-
import { setupRenderingTest } from '<%= modulePrefix =%>/tests/helpers';
2+
import { setupRenderingTest } from 'dummy/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import Foo from '<%= modulePrefix =%>/components/foo';
4+
import Foo from 'dummy/components/foo';
55

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

node-tests/fixtures/component-test/rfc232.gts renamed to node-tests/fixtures/component-test/addon.gts

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { module, test } from 'qunit';
2-
import { setupRenderingTest } from '<%= modulePrefix =%>/tests/helpers';
2+
import { setupRenderingTest } from 'dummy/tests/helpers';
33
import { render } from '@ember/test-helpers';
4-
import Foo from '<%= modulePrefix =%>/components/foo';
4+
import Foo from 'dummy/components/foo';
55

66
module('Integration | Component | foo', function (hooks) {
77
setupRenderingTest(hooks);
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { module, test } from 'qunit';
2+
import { setupRenderingTest } from 'my-app/tests/helpers';
3+
import { render } from '@ember/test-helpers';
4+
import Foo from 'my-app/components/foo';
5+
6+
module('Integration | Component | foo', function (hooks) {
7+
setupRenderingTest(hooks);
8+
9+
test('it renders', async function (assert) {
10+
// Updating values is achieved using autotracking, just like in app code. For example:
11+
// class State { @tracked myProperty = 0; }; const state = new State();
12+
// and update using state.myProperty = 1; await rerender();
13+
// Handle any actions with function myAction(val) { ... };
14+
15+
await render(<template><Foo /></template>);
16+
17+
assert.dom().hasText('');
18+
19+
// Template block usage:
20+
await render(<template>
21+
<Foo>
22+
template block text
23+
</Foo>
24+
</template>);
25+
26+
assert.dom().hasText('template block text');
27+
});
28+
});
+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
import { module, test } from 'qunit';
2+
import { setupRenderingTest } from 'my-app/tests/helpers';
3+
import { render } from '@ember/test-helpers';
4+
import Foo from 'my-app/components/foo';
5+
6+
module('Integration | Component | foo', function (hooks) {
7+
setupRenderingTest(hooks);
8+
9+
test('it renders', async function (assert) {
10+
// Updating values is achieved using autotracking, just like in app code. For example:
11+
// class State { @tracked myProperty = 0; }; const state = new State();
12+
// and update using state.myProperty = 1; await rerender();
13+
// Handle any actions with function myAction(val) { ... };
14+
15+
await render(<template><Foo /></template>);
16+
17+
assert.dom().hasText('');
18+
19+
// Template block usage:
20+
await render(<template>
21+
<Foo>
22+
template block text
23+
</Foo>
24+
</template>);
25+
26+
assert.dom().hasText('template block text');
27+
});
28+
});

0 commit comments

Comments
 (0)