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,39 @@
import {
setupHTMLBuilder,
waitForEndOfOperation,
confirmAddSnippet,
} from "@html_builder/../tests/helpers";
import { describe, expect, test } from "@odoo/hoot";
import { contains } from "@web/../tests/web_test_helpers";
describe.current.tags("desktop");
const dropzone = (hovered = false) => {
const highlightClass = hovered ? " o_dropzone_highlighted" : "";
return `<div class="oe_drop_zone oe_insert${highlightClass}" data-editor-message-default="true" data-editor-message="DRAG BUILDING BLOCKS HERE"></div>`;
};
test("wrapper element has the 'DRAG BUILDING BLOCKS HERE' message", async () => {
const { contentEl } = await setupHTMLBuilder("");
expect(contentEl).toHaveAttribute("data-editor-message", "DRAG BUILDING BLOCKS HERE");
});
test("drop beside dropzone inserts the snippet", async () => {
const { contentEl } = await setupHTMLBuilder();
const { moveTo, drop } = await contains(
".o-snippets-menu #snippet_groups .o_snippet_thumbnail"
).drag();
await moveTo(contentEl.ownerDocument.body);
// The dropzone is not hovered, so not highlighted.
expect(contentEl).toHaveInnerHTML(dropzone());
await drop();
await confirmAddSnippet();
expect(".o_add_snippet_dialog").toHaveCount(0);
await waitForEndOfOperation();
expect(contentEl)
.toHaveInnerHTML(`<section class="s_test" data-snippet="s_test" data-name="Test">
<div class="test_a o-paragraph">
<br>
</div>
</section>`);
});