Files
2024-04-28 11:43:49 +08:00

43 lines
1.3 KiB
JavaScript

/** @odoo-module */
import { getBasicServerData } from "@spreadsheet/../tests/utils/data";
import { createBasicChart } from "@spreadsheet/../tests/utils/commands";
import { setupCollaborativeEnv } from "../utils/collaborative_helpers";
/** @typedef {import("@spreadsheet/o_spreadsheet/o_spreadsheet").Model} Model */
let alice, bob, charlie, network;
QUnit.module("spreadsheet_edition > chart collaborative", {
async beforeEach() {
const env = await setupCollaborativeEnv(getBasicServerData());
alice = env.alice;
bob = env.bob;
charlie = env.charlie;
network = env.network;
},
});
QUnit.test("Chart link to odoo menu collaborative", async (assert) => {
const chartId = "1";
const sheetId = alice.getters.getActiveSheetId();
createBasicChart(alice, chartId);
await network.concurrent(() => {
alice.dispatch("DELETE_FIGURE", { id: chartId, sheetId });
bob.dispatch("LINK_ODOO_MENU_TO_CHART", {
chartId,
odooMenuId: "odooTestMenu",
});
});
assert.spreadsheetIsSynchronized(
[alice, bob, charlie],
(user) => user.getters.getFigures(sheetId),
[]
);
assert.spreadsheetIsSynchronized(
[alice, bob, charlie],
(user) => user.getters.getChartOdooMenu(chartId),
undefined
);
});