-
-
Notifications
You must be signed in to change notification settings - Fork 4.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
blueprints/helper-test: Add RFC232 variants
- Loading branch information
Showing
4 changed files
with
59 additions
and
3 deletions.
There are no files selected for viewing
30 changes: 30 additions & 0 deletions
30
blueprints/helper-test/qunit-rfc-232-files/tests/__testType__/helpers/__name__-test.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
<% if (testType === 'integration') { %>import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('helper:<%= dasherizedModuleName %>', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('it renders', async function(assert) { | ||
this.set('inputValue', '1234'); | ||
|
||
await render(hbs`{{<%= dasherizedModuleName %> inputValue}}`); | ||
|
||
assert.equal(this.$().text().trim(), '1234'); | ||
}); | ||
});<% } else if (testType == 'unit') { %>import { <%= camelizedModuleName %> } from '<%= dasherizedModulePrefix %>/helpers/<%= dasherizedModuleName %>'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('<%= friendlyTestName %>', function(hooks) { | ||
setupTest(hooks); | ||
|
||
// Replace this with your real tests. | ||
test('it works', function(assert) { | ||
let result = <%= camelizedModuleName %>([42]); | ||
assert.ok(result); | ||
}); | ||
});<% } %> | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
import { fooBarBaz } from 'my-app/helpers/foo/bar-baz'; | ||
import { module, test } from 'qunit'; | ||
import { setupTest } from 'ember-qunit'; | ||
|
||
module('Unit | Helper | foo/bar baz', function(hooks) { | ||
setupTest(hooks); | ||
|
||
test('it works', function(assert) { | ||
let result = fooBarBaz([42]); | ||
assert.ok(result); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import hbs from 'htmlbars-inline-precompile'; | ||
|
||
module('Integration | Helper | foo/bar-baz', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('it renders', async function(assert) { | ||
this.set('inputValue', '1234'); | ||
|
||
await render(hbs`{{foo/bar-baz inputValue}}`); | ||
|
||
assert.equal(this.$().text().trim(), '1234'); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters