Skip to content

Commit

Permalink
Update some tests
Browse files Browse the repository at this point in the history
  • Loading branch information
snewcomer committed Oct 4, 2021
1 parent ae63159 commit 8291f84
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 84 deletions.
35 changes: 2 additions & 33 deletions packages/@glimmer/integration-tests/test/ember-component-test.ts
Expand Up @@ -542,7 +542,7 @@ class CurlyScopeTest extends CurlyTest {
}

@test
'correct scope - self lookup inside #each'(assert: Assert) {
'correct scope - self lookup inside #each'() {
this.registerComponent('TemplateOnly', 'SubItem', `<p>{{@name}}</p>`);

let subitems = [{ id: 0 }, { id: 1 }, { id: 42 }];
Expand All @@ -552,8 +552,7 @@ class CurlyScopeTest extends CurlyTest {
<div>
{{#each this.items key="id" as |item|}}
<SubItem @name={{this.id}} />
{{! Intentional property fallback to test self lookup }}
<SubItem @name={{id}} />
<SubItem @name={{this.id}} />
<SubItem @name={{item.id}} />
{{/each}}
</div>`,
Expand All @@ -569,10 +568,6 @@ class CurlyScopeTest extends CurlyTest {
</div>
`
);

assert.validateDeprecations(
/The `id` property was used in the `.*` template without using `this`/
);
}

@test
Expand Down Expand Up @@ -1633,32 +1628,6 @@ class CurlyGlimmerComponentTest extends CurlyTest {
this.assertHTML('Foo');
this.assertStableNodes();
}

@test
'Can use implicit this fallback for `component.name` emberjs/ember.js#19313'(assert: Assert) {
this.registerComponent(
'Glimmer',
'Outer',
'{{component.name}}',
class extends GlimmerishComponent {
get component() {
return { name: 'Foo' };
}
}
);

this.render('<Outer />');
this.assertHTML('Foo');

this.rerender();

this.assertHTML('Foo');
this.assertStableNodes();

assert.validateDeprecations(
/The `component\.name` property path was used in the `.*` template without using `this`/
);
}
}

class CurlyTeardownTest extends CurlyTest {
Expand Down
Expand Up @@ -20,29 +20,6 @@ class DynamicHelpersResolutionModeTest extends RenderTest {
this.assertStableRerender();
}

@test
'Can invoke a helper definition based on this fallback lookup in resolution mode'(
assert: Assert
) {
const foo = defineSimpleHelper(() => 'Hello, world!');
this.registerComponent(
'Glimmer',
'Bar',
'{{x.foo}}',
class extends GlimmerishComponent {
x = { foo };
}
);

this.render('<Bar/>');
this.assertHTML('Hello, world!');
this.assertStableRerender();

assert.validateDeprecations(
/The `x\.foo` property path was used in the `.*` template without using `this`/
);
}

@test
'Can use a dynamic helper with nested helpers'() {
const foo = defineSimpleHelper(() => 'world!');
Expand Down
41 changes: 13 additions & 28 deletions packages/@glimmer/integration-tests/test/updating-test.ts
Expand Up @@ -101,7 +101,7 @@ class UpdatingTest extends RenderTest {
this.render(
stripTight`
<div>
[{{this.[]}}]
[{{this.['']}}]
[{{this.[1]}}]
[{{this.[undefined]}}]
[{{this.[null]}}]
Expand All @@ -110,7 +110,7 @@ class UpdatingTest extends RenderTest {
[{{this.[this]}}]
[{{this.[foo.bar]}}]
[{{this.nested.[]}}]
[{{this.nested.['']}}]
[{{this.nested.[1]}}]
[{{this.nested.[undefined]}}]
[{{this.nested.[null]}}]
Expand All @@ -125,7 +125,7 @@ class UpdatingTest extends RenderTest {

this.assertHTML(stripTight`
<div>
[empty string]
[]
[1]
[undefined]
[null]
Expand All @@ -134,7 +134,7 @@ class UpdatingTest extends RenderTest {
[this]
[foo.bar]
[empty string]
[]
[1]
[undefined]
[null]
Expand All @@ -159,7 +159,7 @@ class UpdatingTest extends RenderTest {

this.assertHTML(stripTight`
<div>
[EMPTY STRING]
[]
[ONE]
[UNDEFINED]
[NULL]
Expand All @@ -168,7 +168,7 @@ class UpdatingTest extends RenderTest {
[THIS]
[FOO.BAR]
[EMPTY STRING]
[]
[ONE]
[UNDEFINED]
[NULL]
Expand Down Expand Up @@ -196,7 +196,7 @@ class UpdatingTest extends RenderTest {

this.assertHTML(stripTight`
<div>
[empty string]
[]
[1]
[undefined]
[null]
Expand All @@ -205,7 +205,7 @@ class UpdatingTest extends RenderTest {
[this]
[foo.bar]
[empty string]
[]
[1]
[undefined]
[null]
Expand All @@ -215,10 +215,6 @@ class UpdatingTest extends RenderTest {
[foo.bar]
</div>
`);

assert.validateDeprecations(
/The `` property was used in the `.*` template without using `this`/
);
}

@test
Expand Down Expand Up @@ -949,8 +945,8 @@ class UpdatingTest extends RenderTest {
foo: "{{foo}}";
bar: "{{bar}}";
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
echo foo: "{{echo this.foo}}";
echo bar: "{{echo this.bar}}";
echo value: "{{echo this.value}}";
-----
Expand All @@ -960,7 +956,7 @@ class UpdatingTest extends RenderTest {
bar: "{{bar}}";
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo bar: "{{echo bar}}";
echo bar: "{{echo this.bar}}";
echo value: "{{echo this.value}}";
-----
Expand All @@ -981,7 +977,7 @@ class UpdatingTest extends RenderTest {
foo: "{{foo}}";
bar: "{{bar}}";
value: "{{this.value}}";
echo foo: "{{echo foo}}";
echo foo: "{{echo this.foo}}";
echo bar: "{{echo bar}}";
echo value: "{{echo this.value}}";
{{/with}}
Expand Down Expand Up @@ -1115,19 +1111,12 @@ class UpdatingTest extends RenderTest {
</div>`,
'After reset'
);

assert.validateDeprecations(
/The `foo` property path was used in the `.*` template without using `this`/,
/The `bar` property path was used in the `.*` template without using `this`/,
/The `bar` property path was used in the `.*` template without using `this`/,
/The `foo` property path was used in the `.*` template without using `this`/
);
}

@test
'block arguments (ensure balanced push/pop)'() {
let person = { name: { first: 'Godfrey', last: 'Chan' } };
this.render('<div>{{#with this.person.name.first as |f|}}{{f}}{{/with}}{{f}}</div>', {
this.render('<div>{{#with this.person.name.first as |f|}}{{f}}{{/with}}{{this.f}}</div>', {
person,
f: 'Outer',
});
Expand All @@ -1138,10 +1127,6 @@ class UpdatingTest extends RenderTest {
this.rerender({ person });

this.assertHTML('<div>GodfreakOuter</div>', 'After updating');

assert.validateDeprecations(
/The `f` property was used in the `.*` template without using `this`/
);
}

@test
Expand Down

0 comments on commit 8291f84

Please sign in to comment.