Skip to content

Commit

Permalink
Merge pull request #335 from camerondubas/master
Browse files Browse the repository at this point in the history
Add additional tests for Colocated Components
  • Loading branch information
rwjblue authored Oct 18, 2019
2 parents 29bbbba + 70a03f7 commit 3a52507
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 0 deletions.
1 change: 1 addition & 0 deletions tests/colocation/app/components/baz/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Module: {{module-name-inliner}}
1 change: 1 addition & 0 deletions tests/colocation/app/components/foo/bar.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Module: {{module-name-inliner}}
1 change: 1 addition & 0 deletions tests/colocation/app/components/foo/baz/index.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Module: {{module-name-inliner}}
18 changes: 18 additions & 0 deletions tests/integration/components/colocation-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,22 @@ module('tests/integration/components/test-inline-precompile', function(hooks) {

assert.equal(this.element.textContent.trim(), 'Module: dummy/components/foo.hbs');
});

test('registered ast plugins run against nested colocated templates (template-only)', async function(assert) {
await render(hbs`<Foo::Bar />`);

assert.equal(this.element.textContent.trim(), 'Module: dummy/components/foo/bar.hbs');
});

test('registered ast plugins run against colocated template index files (template-only)', async function(assert) {
await render(hbs`<Baz />`);

assert.equal(this.element.textContent.trim(), 'Module: dummy/components/baz/index.hbs');
});

test('registered ast plugins run against nested colocated template index files (template-only)', async function(assert) {
await render(hbs`<Foo::Baz />`);

assert.equal(this.element.textContent.trim(), 'Module: dummy/components/foo/baz/index.hbs');
});
});

0 comments on commit 3a52507

Please sign in to comment.