diff --git a/addons/hr_timesheet/static/tests/timesheet_uom_widgets_tests.js b/addons/hr_timesheet/static/tests/timesheet_uom_widgets_tests.js
index 511726709a7..6b4f1227b98 100644
--- a/addons/hr_timesheet/static/tests/timesheet_uom_widgets_tests.js
+++ b/addons/hr_timesheet/static/tests/timesheet_uom_widgets_tests.js
@@ -6,34 +6,35 @@ import { companyService } from "@web/webclient/company_service";
import { timesheetUomService } from "../src/services/timesheet_uom_service";
import { uiService } from "@web/core/ui/ui_service";
import { makeView, setupViewRegistries} from "@web/../tests/views/helpers";
-import { getFixture, patchWithCleanup } from "@web/../tests/helpers/utils";
+import { click, getFixture, patchWithCleanup } from "@web/../tests/helpers/utils";
const serviceRegistry = registry.category("services");
QUnit.module("Timesheet UOM Widgets", (hooks) => {
- const serverData = {
- models: {
- 'account.analytic.line': {
- fields: {
- unit_amount: { string: "Unit Amount", type: "float" },
- },
- records: [
- { id: 1, unit_amount: 8 }
- ],
- },
- },
- views: {
- "account.analytic.line,false,list": `
-
-
-
- `,
- },
- };
+ let serverData;
let target;
hooks.beforeEach(async function (assert) {
setupViewRegistries();
target = getFixture();
+ serverData = {
+ models: {
+ 'account.analytic.line': {
+ fields: {
+ unit_amount: { string: "Unit Amount", type: "float" },
+ },
+ records: [
+ { id: 1, unit_amount: 8 }
+ ],
+ },
+ },
+ views: {
+ "account.analytic.line,false,list": `
+
+
+
+ `,
+ },
+ };
serviceRegistry.add("ui", uiService);
serviceRegistry.add("timesheet_uom", timesheetUomService);
serviceRegistry.add("company", companyService, { force: true });
@@ -80,6 +81,25 @@ QUnit.module("Timesheet UOM Widgets", (hooks) => {
assert.containsOnce(target, 'div[name="unit_amount"]:contains("1")', "TimesheetFloatToggleField should take `timesheet_uom_factor` into account");
});
+ QUnit.test("ranges are working properly in TimesheetFloatToggleField", async function (assert) {
+ serverData.models["account.analytic.line"].records[0].unit_amount = 1;
+ serverData.views["account.analytic.line,false,list"] = serverData.views["account.analytic.line,false,list"].replace('