From 7cb6927512a5d9a3d4a8d549eb977aec7e17037f Mon Sep 17 00:00:00 2001 From: cibernox Date: Sat, 14 Oct 2017 11:08:56 +0200 Subject: [PATCH] Add a more complex example that exercises (I think) most edge cases --- test/unit/build-time-component-test.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/unit/build-time-component-test.ts b/test/unit/build-time-component-test.ts index 6ef9b41..f1a81eb 100644 --- a/test/unit/build-time-component-test.ts +++ b/test/unit/build-time-component-test.ts @@ -751,14 +751,14 @@ describe('BuildTimeComponent', function() { expect(modifiedTemplate).toEqual(`
42
`); }); - it('can have a template which contains a block', function() { + it('can have a template which contains a block with an arg that shadows an external reference', function() { class MyComponent extends BuildTimeComponent { constructor(node: BuildTimeComponentNode, opts?: Partial) { super(node, opts); - this.layout`
{{#each items as |item|}}
{{item.name}}
{{/each}}
` + this.layout`
{{item.name}}{{#each items as |item|}}
{{item.name}}{{some-helper foo thing=bar}}
{{/each}}
` } } - let modifiedTemplate = processTemplate(`{{my-component items=people}}`, { + let modifiedTemplate = processTemplate(`{{my-component items=people item=person foo=bar bar=qux}}`, { MustacheStatement(node) { if (node.path.original === 'my-component') { return new MyComponent(node).toElement(); @@ -766,7 +766,7 @@ describe('BuildTimeComponent', function() { } }); - expect(modifiedTemplate).toEqual(`
{{#each people as |item|}}
{{item.name}}
{{/each}}
`); + expect(modifiedTemplate).toEqual(`
{{person.name}}{{#each people as |item|}}
{{item.name}}{{some-helper bar thing=qux}}<
{{/each}}
`); }); it('can have a template with mustaches inside bound to invocation properties with string literals', function() {