Skip to content

Commit

Permalink
Update tests to emberjs/rfcs#232 format.
Browse files Browse the repository at this point in the history
  • Loading branch information
rwjblue committed Jan 14, 2018
1 parent 5e19052 commit 8391a44
Show file tree
Hide file tree
Showing 24 changed files with 252 additions and 226 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -44,6 +44,7 @@
"ember-cli-uglify": "^2.0.0",
"ember-export-application-global": "^2.0.0",
"ember-load-initializers": "^1.0.0",
"ember-maybe-import-regenerator": "^0.1.6",
"ember-moment": "^7.5.0",
"ember-resolver": "^4.4.0",
"ember-source": "~2.18.0",
Expand Down
34 changes: 18 additions & 16 deletions tests/integration/components/copy-clipboard-test.js
@@ -1,24 +1,26 @@
import { moduleForComponent, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('copy-clipboard', 'Integration | Component | copy clipboard', {
integration: true
});
module('Integration | Component | copy clipboard', function(hooks) {
setupRenderingTest(hooks);

test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{copy-clipboard}}`);
await render(hbs`{{copy-clipboard}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#copy-clipboard}}
template block text
{{/copy-clipboard}}
`);
// Template block usage:
await render(hbs`
{{#copy-clipboard}}
template block text
{{/copy-clipboard}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
18 changes: 10 additions & 8 deletions tests/integration/components/ember-cli-usage-test.js
@@ -1,13 +1,15 @@
import { moduleForComponent, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('ember-cli-usage', 'Integration | Component | ember cli usage', {
integration: true
});
module('Integration | Component | ember cli usage', function(hooks) {
setupRenderingTest(hooks);

test('it renders nothing if project doesn\'t install with Ember CLI', function(assert) {
this.project = { installWithEmberCLI: false };
this.render(hbs`{{ember-cli-usage project=project}}`);
test('it renders nothing if project doesn\'t install with Ember CLI', async function(assert) {
this.project = { installWithEmberCLI: false };
await render(hbs`{{ember-cli-usage project=project}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');
});
});
35 changes: 18 additions & 17 deletions tests/integration/components/files-table-test.js
@@ -1,25 +1,26 @@
import { moduleForComponent } from 'ember-qunit';
import { setupRenderingTest } from 'ember-qunit';
import '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { skip } from 'qunit';
import { module, skip } from 'qunit';

moduleForComponent('files-table', 'Integration | Component | files table', {
integration: true
});
module('Integration | Component | files table', function(hooks) {
setupRenderingTest(hooks);

skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{files-table}}`);
this.render(hbs`{{files-table}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#files-table}}
template block text
{{/files-table}}
`);
// Template block usage:
this.render(hbs`
{{#files-table}}
template block text
{{/files-table}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
35 changes: 18 additions & 17 deletions tests/integration/components/project-listing-test.js
@@ -1,25 +1,26 @@
import { moduleForComponent } from 'ember-qunit';
import { setupRenderingTest } from 'ember-qunit';
import '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { skip } from 'qunit';
import { module, skip } from 'qunit';

moduleForComponent('project-listing', 'Integration | Component | project listing', {
integration: true
});
module('Integration | Component | project listing', function(hooks) {
setupRenderingTest(hooks);

skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{project-listing}}`);
this.render(hbs`{{project-listing}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#project-listing}}
template block text
{{/project-listing}}
`);
// Template block usage:
this.render(hbs`
{{#project-listing}}
template block text
{{/project-listing}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
35 changes: 18 additions & 17 deletions tests/integration/components/project-listing/beta-test.js
@@ -1,25 +1,26 @@
import { moduleForComponent } from 'ember-qunit';
import { setupRenderingTest } from 'ember-qunit';
import '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { skip } from 'qunit';
import { module, skip } from 'qunit';

moduleForComponent('project-listing/beta', 'Integration | Component | project listing/beta', {
integration: true
});
module('Integration | Component | project listing/beta', function(hooks) {
setupRenderingTest(hooks);

skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{project-listing/beta}}`);
this.render(hbs`{{project-listing/beta}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#project-listing/beta}}
template block text
{{/project-listing/beta}}
`);
// Template block usage:
this.render(hbs`
{{#project-listing/beta}}
template block text
{{/project-listing/beta}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
35 changes: 18 additions & 17 deletions tests/integration/components/release-timeline-test.js
@@ -1,25 +1,26 @@
import { moduleForComponent } from 'ember-qunit';
import { setupRenderingTest } from 'ember-qunit';
import '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';
import { skip } from 'qunit';
import { module, skip } from 'qunit';

moduleForComponent('release-timeline', 'Integration | Component | release timeline', {
integration: true
});
module('Integration | Component | release timeline', function(hooks) {
setupRenderingTest(hooks);

skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
skip('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{release-timeline}}`);
this.render(hbs`{{release-timeline}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#release-timeline}}
template block text
{{/release-timeline}}
`);
// Template block usage:
this.render(hbs`
{{#release-timeline}}
template block text
{{/release-timeline}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
34 changes: 18 additions & 16 deletions tests/integration/components/remove-spinner-test.js
@@ -1,24 +1,26 @@
import { moduleForComponent, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('remove-spinner', 'Integration | Component | remove spinner', {
integration: true
});
module('Integration | Component | remove spinner', function(hooks) {
setupRenderingTest(hooks);

test('it renders', function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });
test('it renders', async function(assert) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.on('myAction', function(val) { ... });

this.render(hbs`{{remove-spinner}}`);
await render(hbs`{{remove-spinner}}`);

assert.equal(this.$().text().trim(), '');
assert.equal(this.$().text().trim(), '');

// Template block usage:
this.render(hbs`
{{#remove-spinner}}
template block text
{{/remove-spinner}}
`);
// Template block usage:
await render(hbs`
{{#remove-spinner}}
template block text
{{/remove-spinner}}
`);

assert.equal(this.$().text().trim(), 'template block text');
assert.equal(this.$().text().trim(), 'template block text');
});
});
20 changes: 11 additions & 9 deletions tests/integration/helpers/capitalize-test.js
@@ -1,17 +1,19 @@

import { moduleForComponent, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import hbs from 'htmlbars-inline-precompile';

moduleForComponent('capitalize', 'helper:capitalize', {
integration: true
});
module('helper:capitalize', function(hooks) {
setupRenderingTest(hooks);

// Replace this with your real tests.
test('it renders', function(assert) {
this.set('inputValue', '1234');
// Replace this with your real tests.
test('it renders', async function(assert) {
this.set('inputValue', '1234');

this.render(hbs`{{capitalize inputValue}}`);
await render(hbs`{{capitalize inputValue}}`);

assert.equal(this.$().text().trim(), '1234');
assert.equal(this.$().text().trim(), '1234');
});
});

18 changes: 9 additions & 9 deletions tests/unit/controllers/beta-test.js
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

moduleFor('controller:beta', 'Unit | Controller | beta', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
module('Unit | Controller | beta', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:beta');
assert.ok(controller);
});
});
18 changes: 9 additions & 9 deletions tests/unit/controllers/canary-test.js
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

moduleFor('controller:canary', 'Unit | Controller | canary', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
module('Unit | Controller | canary', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:canary');
assert.ok(controller);
});
});
18 changes: 9 additions & 9 deletions tests/unit/controllers/release-test.js
@@ -1,12 +1,12 @@
import { moduleFor, test } from 'ember-qunit';
import { module, test } from 'qunit';
import { setupTest } from 'ember-qunit';

moduleFor('controller:release', 'Unit | Controller | release', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});
module('Unit | Controller | release', function(hooks) {
setupTest(hooks);

// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.subject();
assert.ok(controller);
// Replace this with your real tests.
test('it exists', function(assert) {
let controller = this.owner.lookup('controller:release');
assert.ok(controller);
});
});

0 comments on commit 8391a44

Please sign in to comment.