Skip to content

Commit

Permalink
Fix generated import paths for test setup functions (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
MinThaMie authored Jul 19, 2022
1 parent a756d94 commit 9ced827
Show file tree
Hide file tree
Showing 6 changed files with 987 additions and 828 deletions.
2 changes: 1 addition & 1 deletion src/markdown/tutorial/part-1/03-automated-testing.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ Let's open the generated test file and replace the boilerplate test with our own
import { module, test } from 'qunit';
-import { visit, currentURL } from '@ember/test-helpers';
+import { click, visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import { setupApplicationTest } from 'super-rentals/tests/helpers';
@@ -7,6 +7,12 @@

- test('visiting /super-rentals', async function (assert) {
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/tutorial/part-1/06-interactive-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ Finally, let's write a test for this new behavior:

```run:file:patch lang=js cwd=super-rentals filename=tests/integration/components/rental/image-test.js
@@ -2,3 +2,3 @@
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from 'super-rentals/tests/helpers';
-import { render } from '@ember/test-helpers';
+import { render, click } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand Down
2 changes: 1 addition & 1 deletion src/markdown/tutorial/part-1/07-reusable-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ We just added a lot of behavior into a single component, so let's write some tes

```run:file:patch lang=js cwd=super-rentals filename=tests/integration/components/map-test.js
@@ -2,4 +2,5 @@
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from 'super-rentals/tests/helpers';
-import { render } from '@ember/test-helpers';
+import { render, find } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/10-service-injection.md
Original file line number Diff line number Diff line change
Expand Up @@ -166,7 +166,7 @@ To be sure, let's add some tests! Let's start with an acceptance test:
import { module, test } from 'qunit';
-import { click, visit, currentURL } from '@ember/test-helpers';
+import { click, find, visit, currentURL } from '@ember/test-helpers';
import { setupApplicationTest } from 'ember-qunit';
import { setupApplicationTest } from 'super-rentals/tests/helpers';
@@ -37,2 +37,13 @@
assert.dom('.rental.detailed').exists();
+ assert.dom('.share.button').hasText('Share on Twitter');
Expand Down Expand Up @@ -259,7 +259,7 @@ We will take advantage of this capability in our component test:
```run:file:patch lang=js cwd=super-rentals filename=tests/integration/components/share-button-test.js
@@ -2,2 +2,3 @@
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from 'super-rentals/tests/helpers';
+import Service from '@ember/service';
import { render } from '@ember/test-helpers';
@@ -5,2 +6,13 @@
Expand Down
4 changes: 2 additions & 2 deletions src/markdown/tutorial/part-2/12-provider-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ Now that we've finished our refactor and tried it out in the UI, let's write a t

```run:file:create lang=js cwd=super-rentals filename=tests/integration/components/rentals-test.js
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from 'super-rentals/tests/helpers';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

Expand Down Expand Up @@ -332,7 +332,7 @@ Hooray, it works! Awesome. Now that we've tried this out manually in the UI, let

```run:file:patch lang=js cwd=super-rentals filename=tests/integration/components/rentals-test.js
@@ -2,3 +2,3 @@
import { setupRenderingTest } from 'ember-qunit';
import { setupRenderingTest } from 'super-rentals/tests/helpers';
-import { render } from '@ember/test-helpers';
+import { render, fillIn } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';
Expand Down
Loading

0 comments on commit 9ced827

Please sign in to comment.