Skip to content

Commit 1a7eb9b

Browse files
author
Robert Jackson
committed
Add more test cases.
Test `moduleForModel` and `moduleForComponent` without `integration: true`.
1 parent 143c013 commit 1a7eb9b

2 files changed

Lines changed: 58 additions & 2 deletions

File tree

__testfixtures__/ember-qunit-codemod/subject.input.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,4 +26,32 @@ test('has some thing', function (assert) {
2626

2727
test('has another thing', function (assert) {
2828
let subject = this.subject({ size: 'big' });
29-
});
29+
});
30+
31+
moduleForModel('foo', 'Integration | Model | Foo', {
32+
integration: true
33+
});
34+
35+
test('has some thing', function (assert) {
36+
let subject = this.subject();
37+
});
38+
39+
moduleForModel('foo', 'Unit | Model | Foo', {
40+
needs: ['serializer:foo']
41+
});
42+
43+
test('has some thing', function (assert) {
44+
let subject = this.subject();
45+
});
46+
47+
moduleForComponent('foo-bar', 'Unit | Component | FooBar', {
48+
unit: true,
49+
});
50+
51+
test('has some thing', function (assert) {
52+
let subject = this.subject();
53+
});
54+
55+
test('has another thing', function (assert) {
56+
let subject = this.subject({ size: 'big' });
57+
});

__testfixtures__/ember-qunit-codemod/subject.output.js

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,4 +27,32 @@ module('Unit | Model | Foo', function(hooks) {
2727
test('has another thing', function (assert) {
2828
let subject = this.owner.factoryFor('model:foo').create({ size: 'big' });
2929
});
30-
});
30+
});
31+
32+
module('Integration | Model | Foo', function(hooks) {
33+
setupTest(hooks);
34+
35+
test('has some thing', function (assert) {
36+
let subject = this.owner.factoryFor('model:foo').create();
37+
});
38+
});
39+
40+
module('Unit | Model | Foo', function(hooks) {
41+
setupTest(hooks);
42+
43+
test('has some thing', function (assert) {
44+
let subject = this.owner.factoryFor('model:foo').create();
45+
});
46+
});
47+
48+
module('Unit | Component | FooBar', function(hooks) {
49+
setupTest(hooks);
50+
51+
test('has some thing', function (assert) {
52+
let subject = this.owner.factoryFor('component:foo-bar').create();
53+
});
54+
55+
test('has another thing', function (assert) {
56+
let subject = this.owner.factoryFor('component:foo-bar').create({ size: 'big' });
57+
});
58+
});

0 commit comments

Comments
 (0)