replace stale web_editor with html_editor and html_builder for 19.0

web_editor was removed in Odoo 19.0 and replaced by html_editor
and html_builder. The old web_editor was incorrectly included in
the 19.0 vanilla import.

🤖 assisted by claude
This commit is contained in:
Ernad Husremovic 2026-03-09 15:31:13 +01:00
parent 4b94f0abc5
commit f866779561
1513 changed files with 396049 additions and 358525 deletions

View file

@ -0,0 +1,44 @@
import {
after,
before,
BEGIN,
END,
SNIPPET_SPECIFIC,
splitBetween,
} from "@html_builder/utils/option_sequence";
import { expect, test } from "@odoo/hoot";
const ARBITRARY_FAKE_POSITION = 7777777777;
test("before throws if position doesn't exist", async () => {
expect(() => before(ARBITRARY_FAKE_POSITION)).toThrow();
});
test("before throws if position is BEGIN", async () => {
expect(() => before(BEGIN)).toThrow();
});
test("before returns a smaller position", async () => {
expect(before(SNIPPET_SPECIFIC)).toBeLessThan(SNIPPET_SPECIFIC);
expect(before(END)).toBeLessThan(END);
});
test("after throws if position doesn't exist", async () => {
expect(() => after(ARBITRARY_FAKE_POSITION)).toThrow();
});
test("after throws if position is END", async () => {
expect(() => after(END)).toThrow();
});
test("after returns a bigger position", async () => {
expect(after(SNIPPET_SPECIFIC)).toBeGreaterThan(SNIPPET_SPECIFIC);
expect(after(BEGIN)).toBeGreaterThan(BEGIN);
});
test("splitBetween correctly splits to the right values", async () => {
expect(splitBetween(0, 3, 2)).toMatch([1, 2]);
expect(splitBetween(0, 10, 2)).toMatch([10 / 3, (2 * 10) / 3]);
expect(splitBetween(0, 8, 7)).toMatch([1, 2, 3, 4, 5, 6, 7]);
expect(splitBetween(1, 5, 3)).toMatch([2, 3, 4]);
});