Skip to content

Commit

Permalink
Add additional test
Browse files Browse the repository at this point in the history
  • Loading branch information
NullVoxPopuli committed May 3, 2023
1 parent 0a31972 commit 79eb370
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion packages/@glimmer/syntax/test/template-locals-test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ QUnit.test('it does not include locals', function (assert) {
assert.deepEqual(locals, ['SomeComponent']);
});

QUnit.test('it can include object-locals', function (assert) {
QUnit.test('it excludes object locals', function (assert) {
let locals = getTemplateLocals(
`
<SomeComponent as |b|>
Expand All @@ -88,6 +88,22 @@ QUnit.test('it can include object-locals', function (assert) {
assert.deepEqual(locals, ['SomeComponent']);
});

QUnit.test('it excludes object locals from nested blocks', function (assert) {
let locals = getTemplateLocals(
`
<SomeComponent as |some|>
<some.foo as |foo|>
<foo.bar as |bar|>
<bar.baz />
</foo.bar>
</some.foo>
</SomeComponent>
`
);

assert.deepEqual(locals, ['SomeComponent']);
});

QUnit.test('it can include keywords', function (assert) {
let locals = getTemplateLocals(
`
Expand Down

0 comments on commit 79eb370

Please sign in to comment.