Skip to content

Commit

Permalink
Add more basic AST plugin tests.
Browse files Browse the repository at this point in the history
Tests for both inline precompilation and precompiled standalone
templates.
  • Loading branch information
rwjblue committed Oct 4, 2019
1 parent e3f2311 commit 6c8d5c8
Show file tree
Hide file tree
Showing 3 changed files with 24 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{{module-name-inliner}}
17 changes: 17 additions & 0 deletions tests/integration/components/ast-plugins-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { module, test } from 'qunit';
import { setupRenderingTest } from 'ember-qunit';
import { render } from '@ember/test-helpers';
import { hbs } from 'ember-cli-htmlbars';

module('tests/integration/components/ast-plugins-test', function(hooks) {
setupRenderingTest(hooks);

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'
);
});
});
6 changes: 6 additions & 0 deletions tests/integration/components/test-inline-precompile-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,10 @@ module('tests/integration/components/test-inline-precompile', function(hooks) {

assert.equal(this.element.textContent.trim(), 'Wheeeee');
});

test('inline templates have AST plugins ran', async function(assert) {
await render(hbsThree('{{module-name-inliner}}', { moduleName: 'hello-template.hbs' }));

assert.equal(this.element.textContent.trim(), 'hello-template.hbs');
});
});

0 comments on commit 6c8d5c8

Please sign in to comment.