Skip to content

Commit

Permalink
feat: update all blueprints to encourage non-duplicate test names
Browse files Browse the repository at this point in the history
  • Loading branch information
mike-north committed Jul 30, 2018
1 parent 2fff67d commit 598adcf
Show file tree
Hide file tree
Showing 10 changed files with 17 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@ import { EmberApplicationTest } from 'ember-qunit-decorators/test-support';
@suite('<%= friendlyTestName %>')
export class <%= testClassName %>AcceptanceTest extends EmberApplicationTest {

@test('visiting /<%= dasherizedModuleName %>')
async visitPage(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'visiting /<%= dasherizedModuleName %>'(assert<% if (isTyped) {%>: Assert<% } %>) {
await visit('/<%= dasherizedModuleName %>');
assert.equal(currentURL(), '/<%= dasherizedModuleName %>');
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,16 @@ import hbs from 'htmlbars-inline-precompile';
@suite('<%= friendlyTestDescription %>')
export class <%= testClassName %>ComponentTest extends EmberRenderingTest {

@test('it renders when used in {{inline-form}}')
async testInline(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'it renders when used in {{inline-form}}'(assert<% if (isTyped) {%>: Assert<% } %>) {
// Set any properties with this.set('myProperty', 'value');
// Handle any actions with this.set('myAction', function(val) { ... });

await render(hbs`{{<%= componentPathName %>}}`);

assert.equal(('' + this.element.textContent).trim(), '');
}
@test('it renders when used in {{#block-form}} {{/block-form}}')

async testBlock(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'it renders when used in {{#block-form}} {{/block-form}}'(assert<% if (isTyped) {%>: Assert<% } %>) {
// Template block usage:
await render(hbs`
{{#<%= componentPathName %>}}
Expand All @@ -33,8 +31,7 @@ export class <%= testClassName %>ComponentTest extends EmberRenderingTest {
@suite('<%= friendlyTestDescription %>')
export class <%= testClassName %> extends EmberTest {

@test('it exists')
itExists(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it exists'(assert<% if (isTyped) {%>: Assert<% } %>) {
let component = this.owner.factoryFor('component:<%= componentPathName %>').create();
assert.ok(component);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { EmberTest } from 'ember-qunit-decorators/test-support';

@suite('<%= friendlyTestDescription %>')
export class <%= testClassName %>ControllerTest extends EmberTest {

// Replace this with your real tests.
@test('it exists')
itExists(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it exists'(assert<% if (isTyped) {%>: Assert<% } %>) {
let controller = this.owner.lookup('controller:<%= controllerPathName %>');
assert.ok(controller);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,7 @@ import hbs from 'htmlbars-inline-precompile';
@suite('<%= friendlyTestName %>')
export class <%= testClassName %>HelperTest extends EmberRenderingTest {
// Replace this with your real tests.
@test('it renders')
async itRenders(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'it renders'(assert<% if (isTyped) {%>: Assert<% } %>) {
this.set('inputValue', '1234');

await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`);
Expand All @@ -20,8 +19,7 @@ import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helper
@suite('<%= friendlyTestName %>')
export class <%= testClassName %>HelperTest extends EmberTest {
// Replace this with your real tests.
@test('it works')
itWorks(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it works'(assert<% if (isTyped) {%>: Assert<% } %>) {
let result = <%= camelizedModuleName %>([42]);
assert.ok(result);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,8 +25,7 @@ export class <%= testClassName %>InitializerTest extends EmberTest {
}

// Replace this with your real tests.
@test('it works')
async itWorks(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'it works'(assert<% if (isTyped) {%>: Assert<% } %>) {
await this.application.boot();

assert.ok(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,7 @@ export class <%= testClassName %>InstanceInitializerTest extends EmberTest {
}

// Replace this with your real tests.
@test('it works')
async itWorks(assert<% if (isTyped) {%>: Assert<% } %>) {
@test async 'it works'(assert<% if (isTyped) {%>: Assert<% } %>) {
await this.instance.boot();

assert.ok(true);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,9 @@ import { suite, test } from 'qunit-decorators';

@suite('<%= friendlyTestName %>')
export class <%= testClassName %>MixinTest {

// Replace this with your real tests.
@test('it works')
itExists(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it works'(assert<% if (isTyped) {%>: Assert<% } %>) {
let <%= classifiedModuleName %>Object = EmberObject.extend(<%= classifiedModuleName %>Mixin);
let subject = <%= classifiedModuleName %>Object.create();
assert.ok(subject);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ import { EmberTest } from 'ember-qunit-decorators/test-support';
@suite('<%= friendlyTestDescription %>')
export class <%= testClassName %>RouteTest extends EmberTest {

@test('it exists')
itExists(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it exists'(assert<% if (isTyped) {%>: Assert<% } %>) {
let route = this.owner.lookup('route:<%= moduleName %>');
assert.ok(route);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { EmberTest } from 'ember-qunit-decorators/test-support';

@suite('<%= friendlyTestDescription %>')
export class <%= testClassName %>ServiceTest extends EmberTest {

// Replace this with your real tests.
@test('it exists')
itExists(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it exists'(assert<% if (isTyped) {%>: Assert<% } %>) {
let service = this.owner.lookup('service:<%= dasherizedModuleName %>');
assert.ok(service);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ import { suite, test } from 'qunit-decorators';

@suite('<%= friendlyTestName %>')
export class <%= testClassName %>Test {

// Replace this with your real tests.
@test('it works')
itWorks(assert<% if (isTyped) {%>: Assert<% } %>) {
@test 'it works'(assert<% if (isTyped) {%>: Assert<% } %>) {
let result = <%= camelizedModuleName %>();
assert.ok(result);
}
Expand Down

0 comments on commit 598adcf

Please sign in to comment.