import { expect, test } from "@odoo/hoot"; import { setupEditor } from "../_helpers/editor"; import { click, queryAll, queryFirst, waitFor } from "@odoo/hoot-dom"; import { animationFrame, tick } from "@odoo/hoot-mock"; import { setSelection } from "../_helpers/selection"; import { execCommand } from "../_helpers/userCommands"; import { expectElementCount } from "../_helpers/ui_expectations"; function insertTable(editor, cols, rows) { execCommand(editor, "insertTable", { cols, rows }); } test("can insert a table", async () => { const { el, editor } = await setupEditor("
hello[]
", {}); insertTable(editor, 4, 3); expect(el.querySelectorAll("tr").length).toBe(3); expect(el.querySelectorAll("td").length).toBe(12); }); test("can color cells", async () => { await setupEditor(`| [ab | c] | ef |