-
Notifications
You must be signed in to change notification settings - Fork 191
/
Copy pathscope.ts
35 lines (30 loc) · 1.03 KB
/
scope.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { RenderTest } from '../render-test';
import { test } from '../test-decorator';
import { stripTight } from '../test-helpers/strings';
export class ScopeSuite extends RenderTest {
static suiteName = 'Scope';
@test
'correct scope - conflicting local names'() {
this.render({
layout: stripTight`
{{#let @a as |item|}}{{@a}}: {{item}},
{{#let @b as |item|}} {{@b}}: {{item}},
{{#let @c as |item|}} {{@c}}: {{item}}{{/let}}
{{/let}}
{{/let}}`,
args: { a: '"A"', b: '"B"', c: '"C"' },
});
this.assertComponent('A: A, B: B, C: C');
this.assertStableRerender();
}
@test
'correct scope - conflicting block param and attr names'() {
this.render({
layout:
'Outer: {{@conflict}} {{#let @item as |conflict|}}Inner: {{@conflict}} Block: {{conflict}}{{/let}}',
args: { item: '"from block"', conflict: '"from attr"' },
});
this.assertComponent('Outer: from attr Inner: from attr Block: from block');
this.assertStableRerender();
}
}