[REF] web: remove usage of LegacyComponent from command_service tests

closes odoo/odoo#86352

Signed-off-by: Jorge Pinna Puissant (jpp) <jpp@odoo.com>
This commit is contained in:
Samuel Degueldre
2022-03-14 17:28:30 +00:00
parent a0a991d08f
commit a87dd572a4
@@ -20,9 +20,8 @@ import {
patchWithCleanup,
triggerHotkey,
} from "../../helpers/utils";
import { LegacyComponent } from "@web/legacy/legacy_component";
const { xml } = owl;
const { Component, xml } = owl;
let env;
let target;
@@ -37,7 +36,7 @@ export async function editSearchBar(searchValue) {
await nextTick();
}
class TestComponent extends LegacyComponent {
class TestComponent extends Component {
get DialogContainer() {
return registry.category("main_components").get("DialogContainer");
}
@@ -137,7 +136,7 @@ QUnit.test("useCommand hook when the activeElement change", async (assert) => {
}
}
class OtherComponent extends LegacyComponent {
class OtherComponent extends Component {
setup() {
useActiveElement("active");
useCommand("I'm taking the throne", () => {});
@@ -200,7 +199,7 @@ QUnit.test("global command with hotkey", async (assert) => {
await nextTick();
assert.verifySteps([globalHotkey, hotkey]);
class MyComponent extends LegacyComponent {
class MyComponent extends Component {
setup() {
useActiveElement("active");
}
@@ -218,7 +217,7 @@ QUnit.test("global command with hotkey", async (assert) => {
QUnit.test("data-hotkey added to command palette", async (assert) => {
assert.expect(8);
class MyComponent extends LegacyComponent {
class MyComponent extends Component {
onClick() {
assert.step("Hodor");
}
@@ -278,7 +277,7 @@ QUnit.test("access to hotkeys from the command palette", async (assert) => {
hotkey,
});
class MyComponent extends LegacyComponent {
class MyComponent extends Component {
onClickB() {
assert.step("B");
}
@@ -831,7 +830,7 @@ QUnit.test("command categories", async (assert) => {
QUnit.test("data-command-category", async (assert) => {
assert.expect(3);
class MyComponent extends LegacyComponent {}
class MyComponent extends Component {}
MyComponent.components = { TestComponent };
MyComponent.template = xml`
<div>
@@ -872,7 +871,7 @@ QUnit.test("data-command-category", async (assert) => {
});
QUnit.test("display shortcuts correctly for non-MacOS ", async (assert) => {
class MyComponent extends LegacyComponent {}
class MyComponent extends Component {}
MyComponent.components = { TestComponent };
MyComponent.template = xml`
<div>
@@ -913,7 +912,7 @@ QUnit.test("display shortcuts correctly for MacOS ", async (assert) => {
},
});
class MyComponent extends LegacyComponent {}
class MyComponent extends Component {}
MyComponent.components = { TestComponent };
MyComponent.template = xml`
<div>
@@ -955,7 +954,7 @@ QUnit.test(
overlayModifier: "alt+control",
});
class MyComponent extends LegacyComponent {}
class MyComponent extends Component {}
MyComponent.components = { TestComponent };
MyComponent.template = xml`
<div>
@@ -988,7 +987,7 @@ QUnit.test("display shortcuts correctly for MacOS with a new overlayModifier", a
overlayModifier: "alt+control",
});
class MyComponent extends LegacyComponent {}
class MyComponent extends Component {}
MyComponent.components = { TestComponent };
MyComponent.template = xml`
<div>