mirror of
https://github.com/bringout/oca-ocb-web.git
synced 2026-04-19 10:11:59 +02:00
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:
parent
4b94f0abc5
commit
f866779561
1513 changed files with 396049 additions and 358525 deletions
|
|
@ -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>`);
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue