Skip to content

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

DEV: Convert d-button test classes to native syntax (#31622)

Jarek Radosz3160ad8fb0aa
diff --git a/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js b/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js
index b10e366261a..0613bb3a87c 100644
--- a/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js
+++ b/app/assets/javascripts/discourse/tests/integration/components/d-button-test.js
@@ -232,15 +232,14 @@ module("Integration | Component | d-button", function (hooks) {
this.set("foo", null);
this.set("legacyActionTriggered", () => this.set("foo", "bar"));
- // eslint-disable-next-line ember/no-classic-classes
- this.classicComponent = ClassicComponent.extend({
- actions: {
+ this.classicComponent = class extends ClassicComponent {
+ actions = {
myLegacyAction() {
this.legacyActionTriggered();
},
- },
- layout: hbs`<DButton @action="myLegacyAction" />`,
- });
+ };
+ layout = hbs`<DButton @action="myLegacyAction" />`;
+ };
await withSilencedDeprecationsAsync(
"discourse.d-button-action-string",
@@ -262,15 +261,14 @@ module("Integration | Component | d-button", function (hooks) {
this.simpleWrapperComponent = class extends ClassicComponent {};
- // eslint-disable-next-line ember/no-classic-classes
- this.classicComponent = ClassicComponent.extend({
- actions: {
+ this.classicComponent = class extends ClassicComponent {
+ actions = {
myLegacyAction() {
this.legacyActionTriggered();
},
- },
- layout: hbs`<@simpleWrapperComponent><DButton @action="myLegacyAction" /></@simpleWrapperComponent>`,
- });
+ };
+ layout = hbs`<@simpleWrapperComponent><DButton @action="myLegacyAction" /></@simpleWrapperComponent>`;
+ };
await withSilencedDeprecationsAsync(
"discourse.d-button-action-string",