diff --git a/src/components/common/quantityInput/QuantityInput.test.tsx b/src/components/common/quantityInput/QuantityInput.test.tsx index ea9f2eceb..870745ffc 100644 --- a/src/components/common/quantityInput/QuantityInput.test.tsx +++ b/src/components/common/quantityInput/QuantityInput.test.tsx @@ -142,14 +142,14 @@ describe("QuantityInput Component", () => { expect(quantityFieldInput.value).toBe(""); expect(onQuantityChange).toBeCalled(); userEvent.type(quantityFieldInput, "-1-"); - await expect(onQuantityChange).toHaveBeenNthCalledWith(2, { + expect(onQuantityChange).toHaveBeenNthCalledWith(2, { unit: "mg", - value: "-1", + value: -1, }); userEvent.type(quantityFieldInput, "2.5/...-"); - await expect(onQuantityChange).toHaveBeenNthCalledWith(6, { + expect(onQuantityChange).toHaveBeenNthCalledWith(6, { unit: "mg", - value: "2.5", + value: 2.5, }); }); }); diff --git a/src/components/common/quantityInput/QuantityInput.tsx b/src/components/common/quantityInput/QuantityInput.tsx index a15467beb..3e1809545 100644 --- a/src/components/common/quantityInput/QuantityInput.tsx +++ b/src/components/common/quantityInput/QuantityInput.tsx @@ -105,7 +105,7 @@ const QuantityInput = ({ const handleQuantityValueChange = (newValue) => { const newQuantity: CQL.Quantity = { - value: newValue, + value: Number(newValue), unit: currentQuantity.unit, }; setCurrentQuantity(newQuantity);