Skip to content

Commit 083c5fa

Browse files
committed
Auto merge of #3247 - Turbo87:rfc-637, r=pichfl
Implement Ember.js RFC 637 see http://emberjs.github.io/rfcs/0637-customizable-test-setups.html r? `@pichfl`
2 parents 182290c + 592c68d commit 083c5fa

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+87
-94
lines changed

tests/acceptance/404-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { currentURL, fillIn, triggerEvent, visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

5-
import setupMirage from '../helpers/setup-mirage';
4+
import { setupApplicationTest } from 'cargo/tests/helpers';
65

76
module('Acceptance | 404', function (hooks) {
87
setupApplicationTest(hooks);
9-
setupMirage(hooks);
108

119
test('/unknown-route shows a 404 page', async function (assert) {
1210
await visit('/unknown-route');

tests/acceptance/api-token-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { click, currentURL, fillIn, findAll } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import { Response } from 'ember-cli-mirage';
76

8-
import setupMirage from '../helpers/setup-mirage';
7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
99
import { visit } from '../helpers/visit-ignoring-abort';
1010

1111
module('Acceptance | api-tokens', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
function prepare(context) {
1615
let user = context.server.create('user', {

tests/acceptance/categories-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76

7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
89
import axeConfig from '../axe-config';
9-
import setupMirage from '../helpers/setup-mirage';
1010

1111
module('Acceptance | categories', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('listing categories', async function (assert) {
1615
this.owner.lookup('service:intl').locale = 'en';

tests/acceptance/crate-following-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11
import { click, settled, visit, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import { defer } from 'rsvp';
65

7-
import setupMirage from '../helpers/setup-mirage';
6+
import { setupApplicationTest } from 'cargo/tests/helpers';
87

98
module('Acceptance | Crate following', function (hooks) {
109
setupApplicationTest(hooks);
11-
setupMirage(hooks);
1210

1311
function prepare(context, { loggedIn = true, following = false } = {}) {
1412
let server = context.server;

tests/acceptance/crate-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { click, currentRouteName, currentURL, visit, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, skip, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76
import { getPageTitle } from 'ember-page-title/test-support';
87

8+
import { setupApplicationTest } from 'cargo/tests/helpers';
9+
910
import axeConfig from '../axe-config';
10-
import setupMirage from '../helpers/setup-mirage';
1111

1212
module('Acceptance | crate page', function (hooks) {
1313
setupApplicationTest(hooks);
14-
setupMirage(hooks);
1514

1615
test('visiting a crate page from the front page', async function (assert) {
1716
this.server.create('crate', { name: 'nanomsg', newest_version: '0.6.1' });

tests/acceptance/crates-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { click, currentURL, visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76
import { getPageTitle } from 'ember-page-title/test-support';
87

8+
import { setupApplicationTest } from 'cargo/tests/helpers';
9+
910
import axeConfig from '../axe-config';
10-
import setupMirage from '../helpers/setup-mirage';
1111

1212
module('Acceptance | crates page', function (hooks) {
1313
setupApplicationTest(hooks);
14-
setupMirage(hooks);
1514

1615
// should match the default set in the crates controller
1716
const per_page = 50;

tests/acceptance/dashboard-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,14 @@
11
import { currentURL } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65

7-
import setupMirage from '../helpers/setup-mirage';
6+
import { setupApplicationTest } from 'cargo/tests/helpers';
7+
88
import { visit } from '../helpers/visit-ignoring-abort';
99

1010
module('Acceptance | Dashboard', function (hooks) {
1111
setupApplicationTest(hooks);
12-
setupMirage(hooks);
1312

1413
test('redirects to / when not logged in', async function (assert) {
1514
await visit('/dashboard');

tests/acceptance/email-change-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { click, currentURL, fillIn } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

5-
import setupMirage from '../helpers/setup-mirage';
4+
import { setupApplicationTest } from 'cargo/tests/helpers';
5+
66
import { visit } from '../helpers/visit-ignoring-abort';
77

88
module('Acceptance | Email Change', function (hooks) {
99
setupApplicationTest(hooks);
10-
setupMirage(hooks);
1110

1211
test('happy path', async function (assert) {
1312
let user = this.server.create('user', { email: '[email protected]' });

tests/acceptance/email-confirmation-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { currentURL } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

5-
import setupMirage from '../helpers/setup-mirage';
4+
import { setupApplicationTest } from 'cargo/tests/helpers';
5+
66
import { visit } from '../helpers/visit-ignoring-abort';
77

88
module('Acceptance | Email Confirmation', function (hooks) {
99
setupApplicationTest(hooks);
10-
setupMirage(hooks);
1110

1211
test('unauthenticated happy path', async function (assert) {
1312
let user = this.server.create('user', { emailVerificationToken: 'badc0ffee' });

tests/acceptance/front-page-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { click, currentURL, settled, visit, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import { defer } from 'rsvp';
@@ -8,13 +7,13 @@ import percySnapshot from '@percy/ember';
87
import a11yAudit from 'ember-a11y-testing/test-support/audit';
98
import { getPageTitle } from 'ember-page-title/test-support';
109

10+
import { setupApplicationTest } from 'cargo/tests/helpers';
11+
1112
import { summary } from '../../mirage/route-handlers/summary';
1213
import axeConfig from '../axe-config';
13-
import setupMirage from '../helpers/setup-mirage';
1414

1515
module('Acceptance | front page', function (hooks) {
1616
setupApplicationTest(hooks);
17-
setupMirage(hooks);
1817

1918
test('visiting /', async function (assert) {
2019
this.owner.lookup('service:intl').locale = 'en';

tests/acceptance/invites-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { click, currentURL } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import Response from 'ember-cli-mirage/response';
76

8-
import setupMirage from '../helpers/setup-mirage';
7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
99
import { visit } from '../helpers/visit-ignoring-abort';
1010

1111
module('Acceptance | /me/pending-invites', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
function prepare(context) {
1615
let user = context.server.create('user');

tests/acceptance/keyword-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76

7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
89
import axeConfig from '../axe-config';
9-
import setupMirage from '../helpers/setup-mirage';
1010

1111
module('Acceptance | keywords', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('keyword/:keyword_id index default sort is recent-downloads', async function (assert) {
1615
this.server.create('keyword', { keyword: 'network' });

tests/acceptance/login-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,16 @@
11
import { click, currentURL, visit, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import { defer } from 'rsvp';
65

76
import window from 'ember-window-mock';
87
import { setupWindowMock } from 'ember-window-mock/test-support';
98

10-
import setupMirage from '../helpers/setup-mirage';
9+
import { setupApplicationTest } from 'cargo/tests/helpers';
1110

1211
module('Acceptance | Login', function (hooks) {
1312
setupApplicationTest(hooks);
1413
setupWindowMock(hooks);
15-
setupMirage(hooks);
1614

1715
test('successful login', async function (assert) {
1816
let deferred = defer();

tests/acceptance/logout-test.js

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import { click, currentURL, visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

5-
import setupMirage from '../helpers/setup-mirage';
4+
import { setupApplicationTest } from 'cargo/tests/helpers';
65

76
module('Acceptance | Logout', function (hooks) {
87
setupApplicationTest(hooks);
9-
setupMirage(hooks);
108

119
test('successful logout', async function (assert) {
1210
let user = this.server.create('user', { name: 'John Doe' });

tests/acceptance/owners-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { click, fillIn, visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76

7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
89
import axeConfig from '../axe-config';
9-
import setupMirage from '../helpers/setup-mirage';
1010

1111
module('Acceptance | /crates/:name/owners', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('listing crate owners', async function (assert) {
1615
this.server.loadFixtures();

tests/acceptance/reverse-dependencies-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
import { click, currentURL } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

5-
import setupMirage from '../helpers/setup-mirage';
4+
import { setupApplicationTest } from 'cargo/tests/helpers';
5+
66
import { visit } from '../helpers/visit-ignoring-abort';
77

88
module('Acceptance | /crates/:crate_id/reverse_dependencies', function (hooks) {
99
setupApplicationTest(hooks);
10-
setupMirage(hooks);
1110

1211
function prepare({ server }) {
1312
let foo = server.create('crate', { name: 'foo' });

tests/acceptance/search-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
import { blur, click, currentURL, fillIn, settled, triggerEvent, visit, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import { defer } from 'rsvp';
@@ -9,13 +8,13 @@ import a11yAudit from 'ember-a11y-testing/test-support/audit';
98
import { keyDown } from 'ember-keyboard/test-support/test-helpers';
109
import { getPageTitle } from 'ember-page-title/test-support';
1110

11+
import { setupApplicationTest } from 'cargo/tests/helpers';
12+
1213
import { list as listCrates } from '../../mirage/route-handlers/crates';
1314
import axeConfig from '../axe-config';
14-
import setupMirage from '../helpers/setup-mirage';
1515

1616
module('Acceptance | search', function (hooks) {
1717
setupApplicationTest(hooks);
18-
setupMirage(hooks);
1918

2019
test('searching for "rust"', async function (assert) {
2120
this.server.loadFixtures();

tests/acceptance/team-page-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76

7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
89
import axeConfig from '../axe-config';
9-
import setupMirage from '../helpers/setup-mirage';
1010

1111
module('Acceptance | team page', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('has team organization display', async function (assert) {
1615
this.server.loadFixtures();

tests/acceptance/token-invites-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { currentURL } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import Response from 'ember-cli-mirage/response';
76

8-
import setupMirage from '../helpers/setup-mirage';
7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
99
import { visit } from '../helpers/visit-ignoring-abort';
1010

1111
module('Acceptance | /accept-invite/:token', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('visiting to /accept-invite shows 404 page', async function (assert) {
1615
await visit('/accept-invite');

tests/acceptance/user-page-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,15 @@
11
import { visit } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import percySnapshot from '@percy/ember';
65
import a11yAudit from 'ember-a11y-testing/test-support/audit';
76

7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
89
import axeConfig from '../axe-config';
9-
import setupMirage from '../helpers/setup-mirage';
1010

1111
module('Acceptance | user page', function (hooks) {
1212
setupApplicationTest(hooks);
13-
setupMirage(hooks);
1413

1514
test('has user display', async function (assert) {
1615
this.server.loadFixtures();

tests/bugs/2329-test.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,16 @@
11
import { click, currentURL, waitFor } from '@ember/test-helpers';
2-
import { setupApplicationTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import window from 'ember-window-mock';
65
import { setupWindowMock } from 'ember-window-mock/test-support';
76

8-
import setupMirage from '../helpers/setup-mirage';
7+
import { setupApplicationTest } from 'cargo/tests/helpers';
8+
99
import { visit } from '../helpers/visit-ignoring-abort';
1010

1111
module('Bug #2329', function (hooks) {
1212
setupApplicationTest(hooks);
1313
setupWindowMock(hooks);
14-
setupMirage(hooks);
1514

1615
test('is fixed', async function (assert) {
1716
let user = this.server.create('user');

tests/components/crate-row-test.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
11
import { render } from '@ember/test-helpers';
2-
import { setupRenderingTest } from 'ember-qunit';
32
import { module, test } from 'qunit';
43

54
import { hbs } from 'ember-cli-htmlbars';
65

6+
import { setupRenderingTest } from 'cargo/tests/helpers';
7+
78
import setupMirage from '../helpers/setup-mirage';
89

910
module('Component | CrateRow', function (hooks) {

0 commit comments

Comments
 (0)