Skip to content

Commit

Permalink
New in Ember v4.3: Enabled ember-cli-mirage and ember-intl in every a…
Browse files Browse the repository at this point in the history
…pplication test
  • Loading branch information
ijlee2 committed Aug 1, 2023
1 parent 71506a9 commit 479780a
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 25 deletions.
6 changes: 1 addition & 5 deletions tests/acceptance/form-test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { click, currentURL, visit } from '@ember/test-helpers';
import { a11yAudit } from 'ember-a11y-testing/test-support';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { getPageTitle } from 'ember-page-title/test-support';
import { setupApplicationTest } from 'ember-qunit';
import {
assignVariants,
fillContactMeForm,
setupApplicationTest,
} from 'ember-workshop/tests/helpers';
import { Response } from 'miragejs';
import { module, test } from 'qunit';

module('Acceptance | form', function (hooks) {
setupApplicationTest(hooks);
setupIntl(hooks);
setupMirage(hooks);

test('Accessibility audit', async function (assert) {
await visit('/form');
Expand Down
6 changes: 1 addition & 5 deletions tests/acceptance/index-test.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,11 @@
import { currentURL, visit } from '@ember/test-helpers';
import { a11yAudit } from 'ember-a11y-testing/test-support';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { getPageTitle } from 'ember-page-title/test-support';
import { setupApplicationTest } from 'ember-qunit';
import { setupApplicationTest } from 'ember-workshop/tests/helpers';
import { module, test } from 'qunit';

module('Acceptance | index', function (hooks) {
setupApplicationTest(hooks);
setupIntl(hooks);
setupMirage(hooks);

test('Accessibility audit', async function (assert) {
await visit('/');
Expand Down
6 changes: 1 addition & 5 deletions tests/acceptance/product-details-test.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,16 @@
import { click, currentURL, findAll, visit } from '@ember/test-helpers';
import { a11yAudit } from 'ember-a11y-testing/test-support';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { getPageTitle } from 'ember-page-title/test-support';
import { setupApplicationTest } from 'ember-qunit';
import {
assignVariants,
setupApplicationTest,
setupCustomAssertionsForProducts,
} from 'ember-workshop/tests/helpers';
import { module, test } from 'qunit';

module('Acceptance | product details', function (hooks) {
setupApplicationTest(hooks);
setupCustomAssertionsForProducts(hooks);
setupIntl(hooks);
setupMirage(hooks);

hooks.beforeEach(function () {
this.product = this.server.create('product', {
Expand Down
6 changes: 1 addition & 5 deletions tests/acceptance/products-test.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,17 @@
import { click, currentURL, fillIn, findAll, visit } from '@ember/test-helpers';
import { a11yAudit } from 'ember-a11y-testing/test-support';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { getPageTitle } from 'ember-page-title/test-support';
import { setupApplicationTest } from 'ember-qunit';
import {
assignVariants,
selectByLabel,
setupApplicationTest,
setupCustomAssertionsForProducts,
} from 'ember-workshop/tests/helpers';
import { module, test } from 'qunit';

module('Acceptance | products', function (hooks) {
setupApplicationTest(hooks);
setupCustomAssertionsForProducts(hooks);
setupIntl(hooks);
setupMirage(hooks);

hooks.beforeEach(function () {
this.server.create('product', {
Expand Down
6 changes: 1 addition & 5 deletions tests/acceptance/products/product-test.js
Original file line number Diff line number Diff line change
@@ -1,18 +1,14 @@
import { currentURL, visit } from '@ember/test-helpers';
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import { setupApplicationTest } from 'ember-qunit';
import {
assignVariants,
setupApplicationTest,
setupCustomAssertionsForProducts,
} from 'ember-workshop/tests/helpers';
import { module, test } from 'qunit';

module('Acceptance | products/product', function (hooks) {
setupApplicationTest(hooks);
setupCustomAssertionsForProducts(hooks);
setupIntl(hooks);
setupMirage(hooks);

hooks.beforeEach(function () {
this.server.create('product', {
Expand Down
5 changes: 5 additions & 0 deletions tests/helpers/index.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { setupMirage } from 'ember-cli-mirage/test-support';
import { setupIntl } from 'ember-intl/test-support';
import {
setupApplicationTest as upstreamSetupApplicationTest,
setupRenderingTest as upstreamSetupRenderingTest,
Expand Down Expand Up @@ -25,6 +27,9 @@ function setupApplicationTest(hooks, options) {
//
// setupIntl(hooks); // ember-intl
// setupMirage(hooks); // ember-cli-mirage

setupIntl(hooks);
setupMirage(hooks);
}

function setupRenderingTest(hooks, options) {
Expand Down

0 comments on commit 479780a

Please sign in to comment.