Skip to content

A platform for community discussion. Free, open, simple.

Unsilence this-property-fallback (#21615)

David Taylor6084b331ed89
diff --git a/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-parent-view-test.js b/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-parent-view-test.js
index 12683437209..053db157d01 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-parent-view-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-parent-view-test.js
@@ -9,7 +9,7 @@ acceptance("Plugin Outlet - Deprecated parentView", function (needs) {
needs.hooks.beforeEach(function () {
registerTemporaryModule(
"discourse/templates/connectors/user-profile-primary/hello",
- hbs`<span class='hello-username'>{{parentView.parentView.class}}</span>`
+ hbs`<span class='hello-username'>{{this.parentView.parentView.class}}</span>`
);
});
diff --git a/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-single-template-test.js b/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-single-template-test.js
index 5022ac3fe2c..a7b3fe8355e 100644
--- a/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-single-template-test.js
+++ b/app/assets/javascripts/discourse/tests/acceptance/plugin-outlet-single-template-test.js
@@ -15,7 +15,7 @@ acceptance("Plugin Outlet - Single Template", function (needs) {
needs.hooks.beforeEach(() => {
registerTemporaryModule(
CONNECTOR_MODULE,
- hbs`<span class='hello-username'>{{model.username}}</span>`
+ hbs`<span class='hello-username'>{{this.model.username}}</span>`
);
});
diff --git a/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.js b/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.js
index adf2000528d..86abc660620 100644
--- a/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.js
+++ b/app/assets/javascripts/discourse/tests/addons/truth-helpers/integration/helpers/includes-test.js
@@ -11,14 +11,14 @@ module("Addons | truth-helpers | Integration | includes", function (hooks) {
this.foo = [1];
this.bar = 1;
await render(
- hbs`{{#if (includes foo bar)}}<span class="test"></span>{{/if}}`
+ hbs`{{#if (includes this.foo this.bar)}}<span class="test"></span>{{/if}}`
);
assert.ok(exists(".test"), "it returns true when element is found");
this.bar = 2;
await render(
- hbs`{{#if (includes foo bar)}}<span class="test"></span>{{/if}}`
+ hbs`{{#if (includes this.foo this.bar)}}<span class="test"></span>{{/if}}`
);
assert.notOk(exists(".test"), "it returns false when element is not found");
@@ -28,14 +28,14 @@ module("Addons | truth-helpers | Integration | includes", function (hooks) {
this.foo = "foo";
this.bar = "f";
await render(
- hbs`{{#if (includes foo bar)}}<span class="test"></span>{{/if}}`
+ hbs`{{#if (includes this.foo this.bar)}}<span class="test"></span>{{/if}}`
);
assert.ok(exists(".test"), "it returns true when element is found");
this.bar = "b";
await render(
- hbs`{{#if (includes foo bar)}}<span class="test"></span>{{/if}}`
+ hbs`{{#if (includes this.foo this.bar)}}<span class="test"></span>{{/if}}`
);
assert.notOk(exists(".test"), "it returns false when element is not found");
diff --git a/app/assets/javascripts/discourse/tests/integration/components/category-badge-helper-test.js b/app/assets/javascripts/discourse/tests/integration/components/category-badge-helper-test.js
index 44269f5a556..7a8b8a8c62a 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/category-badge-helper-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/category-badge-helper-test.js
@@ -11,7 +11,7 @@ module("Integration | Component | category-badge helper", function (hooks) {
test("displays category", async function (assert) {
this.set("category", Category.findById(1));
- await render(hbs`{{category-badge category}}`);
+ await render(hbs`{{category-badge this.category}}`);
assert.strictEqual(
query(".category-name").innerText.trim(),
@@ -22,7 +22,7 @@ module("Integration | Component | category-badge helper", function (hooks) {
test("options.link", async function (assert) {
this.set("category", Category.findById(1));
- await render(hbs`{{category-badge category link=true}}`);
+ await render(hbs`{{category-badge this.category link=true}}`);
assert.ok(
exists(
diff --git a/app/assets/javascripts/discourse/tests/integration/components/html-safe-helper-test.js b/app/assets/javascripts/discourse/tests/integration/components/html-safe-helper-test.js
index 35a5df3ea30..32d70d8d08b 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/html-safe-helper-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/html-safe-helper-test.js
@@ -10,7 +10,7 @@ module("Integration | Component | html-safe-helper", function (hooks) {
test("default", async function (assert) {
this.set("string", "<p class='cookies'>biscuits</p>");
- await render(hbs`{{html-safe string}}`);
+ await render(hbs`{{html-safe this.string}}`);
assert.ok(exists("p.cookies"), "it displays the string as html");
});
diff --git a/app/assets/javascripts/discourse/tests/integration/components/plugin-outlet-test.js b/app/assets/javascripts/discourse/tests/integration/components/plugin-outlet-test.js
index a3cf9ff01b8..4d44b2c426d 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/plugin-outlet-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/plugin-outlet-test.js
@@ -53,15 +53,15 @@ module("Integration | Component | plugin-outlet", function (hooks) {
registerTemporaryModule(
`${PREFIX}/test-name/hello`,
- hbs`<span class='hello-username'>{{username}}</span>
+ hbs`<span class='hello-username'>{{this.username}}</span>
<button class='say-hello' {{on "click" (action "sayHello")}}></button>
<button class='say-hello-using-this' {{on "click" this.sayHello}}></button>
- <span class='hello-result'>{{hello}}</span>`
+ <span class='hello-result'>{{this.hello}}</span>`
);
registerTemporaryModule(
`${PREFIX}/test-name/hi`,
hbs`<button class='say-hi' {{on "click" (action "sayHi")}}></button>
- <span class='hi-result'>{{hi}}</span>`
+ <span class='hi-result'>{{this.hi}}</span>`
);
registerTemporaryModule(
`${PREFIX}/test-name/conditional-render`,
diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/combo-box-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/combo-box-test.js
index 106985059b7..8899ed8e7d4 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/combo-box-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/combo-box-test.js
@@ -75,8 +75,8 @@ module("Integration | Component | select-kit/combo-box", function (hooks) {
@value={{this.value}}
@content={{this.content}}
@options={{hash
- caretUpIcon=caretUpIcon
- caretDownIcon=caretDownIcon
+ caretUpIcon=this.caretUpIcon
+ caretDownIcon=this.caretDownIcon
}}
/>
`);
diff --git a/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js b/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js
index b652adc4699..89b80b856cf 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/select-kit/future-date-input-test.js
@@ -129,7 +129,7 @@ module(
this.set("input", moment("2032-01-01 11:10"));
await render(
- hbs`<FutureDateInput @input={{this.input}} @onChangeInput={{action (mut input)}} />`
+ hbs`<FutureDateInput @input={{this.input}} @onChangeInput={{action (mut this.input)}} />`
);
await fillIn(".time-input", "11:15");