oca-ocb-hr/odoo-bringout-oca-ocb-hr_timesheet/hr_timesheet/static/tests/timesheet_graph.test.js
Ernad Husremovic e1d89e11e3 19.0 vanilla
2026-03-09 09:31:00 +01:00

29 lines
940 B
JavaScript

import { test } from "@odoo/hoot";
import { mountView, serverState } from "@web/../tests/web_test_helpers";
import { defineTimesheetModels } from "./hr_timesheet_models";
import { checkDatasets } from "@web/../tests/views/graph/graph_test_helpers";
defineTimesheetModels();
test("hr.timesheet (graph): data are not multiplied by a company related factor (factor === 1)", async () => {
serverState.companies[0].timesheet_uom_factor = 1;
const graph = await mountView({
resModel: "account.analytic.line",
type: "graph",
});
checkDatasets(graph, "data", { data: [8] });
});
test("hr.timesheet (graph): data are multiplied by a company related factor (factor !== 1)", async () => {
serverState.companies[0].timesheet_uom_factor = 0.125;
const graph = await mountView({
resModel: "account.analytic.line",
type: "graph",
});
checkDatasets(graph, "data", { data: [1] });
});