Skip to content

Commit

Permalink
Remove unused testing helper files.
Browse files Browse the repository at this point in the history
As of ember-source@3.0.0 (and ember-data@3.0.0) the testing blueprints
are automatically emitting emberjs/rfcs#232 or emberjs/rfcs#268
compatible output. With those, these helpers are no longer used for new
apps.

Existing apps should only delete these files once they have migrated to
the new testing system...
  • Loading branch information
rwjblue committed Jan 11, 2018
1 parent 7a86445 commit c0f1956
Show file tree
Hide file tree
Showing 13 changed files with 52 additions and 174 deletions.
Empty file.
5 changes: 0 additions & 5 deletions blueprints/app/files/tests/helpers/destroy-app.js

This file was deleted.

21 changes: 0 additions & 21 deletions blueprints/app/files/tests/helpers/module-for-acceptance.js

This file was deleted.

17 changes: 0 additions & 17 deletions blueprints/app/files/tests/helpers/start-app.js

This file was deleted.

Empty file.

This file was deleted.

This file was deleted.

16 changes: 0 additions & 16 deletions blueprints/module-unification-app/files/tests/helpers/start-app.js

This file was deleted.

@@ -1,30 +1,22 @@
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import Ember from 'ember';
import { setupAcceptanceTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('Acceptance', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('Acceptance', function(hooks) {
setupApplicationTest(hooks);

test('renders properly', function(assert) {
visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.basic-thing');
assert.equal(element.first().text().trim(), 'WOOT!!');
var element = this.element.querySelector('.basic-thing');
assert.equal(element.textContent, 'WOOT!!');
});
});

test('renders imported component', function(assert) {
visit('/');
test('renders imported component', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.second-thing');
assert.equal(element.first().text().trim(), 'SECOND!!');
var element = this.element.querySelector('.second-thing');
assert.equal(element.textContent, 'SECOND!!');
});
});
34 changes: 13 additions & 21 deletions tests/fixtures/addon/kitchen-sink/tests/acceptance/main-test.js
@@ -1,32 +1,24 @@
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import Ember from 'ember';
import { setupAcceptanceTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import truthyHelper from 'kitchen-sink/test-support/helper';
import { module, test } from 'qunit';

module('Acceptance', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('Acceptance', function(hooks) {
setupApplicationTest(hooks);

test('renders properly', function(assert) {
visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.basic-thing');
assert.equal(element.first().text().trim(), 'WOOT!!');
var element = this.element.querySelector('.basic-thing');
assert.equal(element.textContent, 'WOOT!!');
assert.ok(truthyHelper(), 'addon-test-support helper');
});
});

test('renders imported component', function(assert) {
visit('/');
test('renders imported component', async function(assert) {
await visit('/');

andThen(function() {
var element = find('.second-thing');
assert.equal(element.first().text().trim(), 'SECOND!!');
var element = this.element.querySelector('.second-thing');
assert.equal(element.textContent, 'SECOND!!');
});
});
@@ -1,23 +1,15 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupAcceptanceTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('default-development - Integration', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});

test('the application boots properly', function(assert) {
assert.expect(1);
module('default-development - Integration', function(hook) {
setupApplicationTest(hooks);

visit('/');
test('renders properly', async function(assert) {
await visit('/');

andThen(function() {
assert.ok(Ember.$('.ember-view').length > 0);
var elements = this.element.querySelectorAll('.ember-view');
assert.ok(elements.length > 0);
});
});
@@ -1,23 +1,17 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupAcceptanceTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('pods based templates', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});
module('pods based templates', function(hooks) {
setupApplicationTest(hooks);

test('the application boots properly with pods based templates', function(assert) {
assert.expect(1);
test('the application boots properly with pods based templates', async function(assert) {
assert.expect(1);

visit('/');
await visit('/');

andThen(function() {
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
let actual = this.element.querySelector('#title').textContent
assert.equal(actual, 'ZOMG, PODS WORKS!!');
});
});
@@ -1,24 +1,17 @@
import Ember from 'ember';
import startApp from '../helpers/start-app';
import destroyApp from '../helpers/destroy-app';
import { setupAcceptanceTest } from 'ember-qunit';
import { visit } from '@ember/test-helpers';
import { module, test } from 'qunit';

module('pods based templates', {
beforeEach() {
this.application = startApp();
},
afterEach() {
destroyApp(this.application);
}
});

module('pods based templates', function(hooks) {
setupApplicationTest(hooks);

test('the application boots properly with pods based templates with a podModulePrefix set', function(assert) {
assert.expect(1);
test('the application boots properly with pods based templates with a podModulePrefix set', async function(assert) {
assert.expect(1);

visit('/');
await visit('/');

andThen(function() {
assert.equal(Ember.$('#title').text(), 'ZOMG, PODS WORKS!!');
let actual = this.element.querySelector('#title').textContent
assert.equal(actual, 'ZOMG, PODS WORKS!!');
});
});

0 comments on commit c0f1956

Please sign in to comment.