| 1 |
import { test } from "@odoo/hoot"; |
| 2 |
import { mountView, serverState } from "@web/../tests/web_test_helpers"; |
| 3 |
|
| 4 |
import { defineTimesheetModels } from "./hr_timesheet_models"; |
| 5 |
import { checkDatasets } from "@web/../tests/views/graph/graph_test_helpers"; |
| 6 |
|
| 7 |
defineTimesheetModels(); |
| 8 |
|
| 9 |
test("hr.timesheet (graph): data are not multiplied by a company related factor (factor === 1)", async () => { |
| 10 |
serverState.companies[0].timesheet_uom_factor = 1; |
| 11 |
|
| 12 |
const graph = await mountView({ |
| 13 |
resModel: "account.analytic.line", |
| 14 |
type: "graph", |
| 15 |
}); |
| 16 |
|
| 17 |
checkDatasets(graph, "data", { data: [8] }); |
| 18 |
}); |
| 19 |
|
| 20 |
test("hr.timesheet (graph): data are multiplied by a company related factor (factor !== 1)", async () => { |
| 21 |
serverState.companies[0].timesheet_uom_factor = 0.125; |
| 22 |
|
| 23 |
const graph = await mountView({ |
| 24 |
resModel: "account.analytic.line", |
| 25 |
type: "graph", |
| 26 |
}); |
| 27 |
|
| 28 |
checkDatasets(graph, "data", { data: [1] }); |
| 29 |
}); |