-
-
Notifications
You must be signed in to change notification settings - Fork 67
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add more tests using AST plugins (inline and standalone) (#125)
Add more tests using AST plugins (inline and standalone)
- Loading branch information
Showing
5 changed files
with
93 additions
and
0 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
tests/dummy/app/templates/components/x-module-name-inlined-component.hbs
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 @@ | ||
{{module-name-inliner}} |
1 change: 1 addition & 0 deletions
1
tests/dummy/app/templates/components/x-module-name-reversed-component.hbs
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 @@ | ||
{{module-name-reverser}} |
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
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,29 @@ | ||
import { module, test } from 'qunit'; | ||
import { setupRenderingTest } from 'ember-qunit'; | ||
import { render } from '@ember/test-helpers'; | ||
import { hbs } from 'ember-cli-htmlbars'; | ||
import hasEmberVersion from '@ember/test-helpers/has-ember-version'; | ||
|
||
module('tests/integration/components/ast-plugins-test', function(hooks) { | ||
setupRenderingTest(hooks); | ||
|
||
test('stand alone templates have "legacy" AST plugins ran', async function(assert) { | ||
await render(hbs`{{x-module-name-reversed-component}}`); | ||
|
||
assert.equal( | ||
this.element.textContent.trim(), | ||
'sbh.tnenopmoc-desrever-eman-eludom-x/stnenopmoc/setalpmet/ymmud' | ||
); | ||
}); | ||
|
||
if (hasEmberVersion(3, 1)) { | ||
test('stand alone templates have AST plugins ran', async function(assert) { | ||
await render(hbs`{{x-module-name-inlined-component}}`); | ||
|
||
assert.equal( | ||
this.element.textContent.trim(), | ||
'dummy/templates/components/x-module-name-inlined-component.hbs' | ||
); | ||
}); | ||
} | ||
}); |
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