From 8291f841c270b7ef977539f6bacd1040293ad6e0 Mon Sep 17 00:00:00 2001 From: Scott Newcomer Date: Sun, 29 Aug 2021 08:31:57 -0500 Subject: [PATCH] Update some tests --- .../test/ember-component-test.ts | 35 +--------------- .../test/helpers/dynamic-helpers-test.ts | 23 ----------- .../integration-tests/test/updating-test.ts | 41 ++++++------------- 3 files changed, 15 insertions(+), 84 deletions(-) diff --git a/packages/@glimmer/integration-tests/test/ember-component-test.ts b/packages/@glimmer/integration-tests/test/ember-component-test.ts index 45e57eaeb..a8e431abd 100644 --- a/packages/@glimmer/integration-tests/test/ember-component-test.ts +++ b/packages/@glimmer/integration-tests/test/ember-component-test.ts @@ -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', `

{{@name}}

`); let subitems = [{ id: 0 }, { id: 1 }, { id: 42 }]; @@ -552,8 +552,7 @@ class CurlyScopeTest extends CurlyTest {
{{#each this.items key="id" as |item|}} - {{! Intentional property fallback to test self lookup }} - + {{/each}}
`, @@ -569,10 +568,6 @@ class CurlyScopeTest extends CurlyTest { ` ); - - assert.validateDeprecations( - /The `id` property was used in the `.*` template without using `this`/ - ); } @test @@ -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(''); - 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 { diff --git a/packages/@glimmer/integration-tests/test/helpers/dynamic-helpers-test.ts b/packages/@glimmer/integration-tests/test/helpers/dynamic-helpers-test.ts index 28c51a24b..33263e51a 100644 --- a/packages/@glimmer/integration-tests/test/helpers/dynamic-helpers-test.ts +++ b/packages/@glimmer/integration-tests/test/helpers/dynamic-helpers-test.ts @@ -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(''); - 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!'); diff --git a/packages/@glimmer/integration-tests/test/updating-test.ts b/packages/@glimmer/integration-tests/test/updating-test.ts index 3de288b05..b2f21e5a4 100644 --- a/packages/@glimmer/integration-tests/test/updating-test.ts +++ b/packages/@glimmer/integration-tests/test/updating-test.ts @@ -101,7 +101,7 @@ class UpdatingTest extends RenderTest { this.render( stripTight`
- [{{this.[]}}] + [{{this.['']}}] [{{this.[1]}}] [{{this.[undefined]}}] [{{this.[null]}}] @@ -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]}}] @@ -125,7 +125,7 @@ class UpdatingTest extends RenderTest { this.assertHTML(stripTight`
- [empty string] + [] [1] [undefined] [null] @@ -134,7 +134,7 @@ class UpdatingTest extends RenderTest { [this] [foo.bar] - [empty string] + [] [1] [undefined] [null] @@ -159,7 +159,7 @@ class UpdatingTest extends RenderTest { this.assertHTML(stripTight`
- [EMPTY STRING] + [] [ONE] [UNDEFINED] [NULL] @@ -168,7 +168,7 @@ class UpdatingTest extends RenderTest { [THIS] [FOO.BAR] - [EMPTY STRING] + [] [ONE] [UNDEFINED] [NULL] @@ -196,7 +196,7 @@ class UpdatingTest extends RenderTest { this.assertHTML(stripTight`
- [empty string] + [] [1] [undefined] [null] @@ -205,7 +205,7 @@ class UpdatingTest extends RenderTest { [this] [foo.bar] - [empty string] + [] [1] [undefined] [null] @@ -215,10 +215,6 @@ class UpdatingTest extends RenderTest { [foo.bar]
`); - - assert.validateDeprecations( - /The `` property was used in the `.*` template without using `this`/ - ); } @test @@ -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}}"; ----- @@ -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}}"; ----- @@ -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}} @@ -1115,19 +1111,12 @@ class UpdatingTest extends RenderTest {
`, '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('
{{#with this.person.name.first as |f|}}{{f}}{{/with}}{{f}}
', { + this.render('
{{#with this.person.name.first as |f|}}{{f}}{{/with}}{{this.f}}
', { person, f: 'Outer', }); @@ -1138,10 +1127,6 @@ class UpdatingTest extends RenderTest { this.rerender({ person }); this.assertHTML('
GodfreakOuter
', 'After updating'); - - assert.validateDeprecations( - /The `f` property was used in the `.*` template without using `this`/ - ); } @test