diff --git a/src/components/plans/GraduatedChargeTable.tsx b/src/components/plans/GraduatedChargeTable.tsx index 1d5ba7d46..7d269f2f3 100644 --- a/src/components/plans/GraduatedChargeTable.tsx +++ b/src/components/plans/GraduatedChargeTable.tsx @@ -59,7 +59,7 @@ export const GraduatedChargeTable = ({ }: GraduatedChargeTableProps) => { const { translate } = useInternationalization() const [errorIndex, setErrorIndex] = useState() - const { tableDatas, addRange, handleUpdate, deleteRange, infosCaclucation } = + const { tableDatas, addRange, handleUpdate, deleteRange, infosCalculation } = useGraduatedChargeForm({ chargeIndex, disabled, @@ -214,7 +214,7 @@ export const GraduatedChargeTable = ({ <> - {infosCaclucation.map((calculation, i) => { + {infosCalculation.map((calculation, i) => { if (i === 0) { return ( @@ -230,7 +230,7 @@ export const GraduatedChargeTable = ({ ) } if (i === 1) { - return infosCaclucation.length === 2 ? ( + return infosCalculation.length === 2 ? ( {translate('text_64cac576a11db000acb130b2', { tier1LastUnit: ONE_TIER_EXAMPLE_UNITS, diff --git a/src/hooks/plans/__tests__/useGraduatedChargeForm.test.tsx b/src/hooks/plans/__tests__/useGraduatedChargeForm.test.tsx index b431b6e4a..e3d4f8f4c 100644 --- a/src/hooks/plans/__tests__/useGraduatedChargeForm.test.tsx +++ b/src/hooks/plans/__tests__/useGraduatedChargeForm.test.tsx @@ -96,7 +96,7 @@ describe('useGraduatedRange()', () => { { ...DEFAULT_GRADUATED_CHARGES[1], disabledDelete: false }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '2', total: 0, @@ -147,7 +147,7 @@ describe('useGraduatedRange()', () => { disabledDelete: false, }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 0, @@ -199,7 +199,7 @@ describe('useGraduatedRange()', () => { }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '2', total: 9, @@ -222,7 +222,7 @@ describe('useGraduatedRange()', () => { ]) await act(async () => await result.current.addRange()) await act(async () => await result.current.handleUpdate(1, 'perUnitAmount', '8')) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 25, @@ -250,7 +250,7 @@ describe('useGraduatedRange()', () => { }, ]) await act(async () => await result.current.handleUpdate(1, 'flatAmount', '9')) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 34, @@ -300,7 +300,7 @@ describe('useGraduatedRange()', () => { disabledDelete: false, }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '5', total: 0, @@ -324,7 +324,7 @@ describe('useGraduatedRange()', () => { await act(async () => await result.current.addRange()) await act(async () => await result.current.handleUpdate(1, 'toValue', 8)) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '9', total: 0, @@ -413,7 +413,7 @@ describe('useGraduatedRange()', () => { { ...DEFAULT_GRADUATED_CHARGES[1], disabledDelete: false }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '2', total: 0, @@ -464,7 +464,7 @@ describe('useGraduatedRange()', () => { disabledDelete: false, }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 0, @@ -516,7 +516,7 @@ describe('useGraduatedRange()', () => { }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '2', total: 9, @@ -539,7 +539,7 @@ describe('useGraduatedRange()', () => { ]) await act(async () => await result.current.addRange()) await act(async () => await result.current.handleUpdate(1, 'perUnitAmount', '8')) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 25, @@ -567,7 +567,7 @@ describe('useGraduatedRange()', () => { }, ]) await act(async () => await result.current.handleUpdate(1, 'flatAmount', '9')) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '4', total: 34, @@ -617,7 +617,7 @@ describe('useGraduatedRange()', () => { disabledDelete: false, }, ]) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '5', total: 0, @@ -641,7 +641,7 @@ describe('useGraduatedRange()', () => { await act(async () => await result.current.addRange()) await act(async () => await result.current.handleUpdate(1, 'toValue', 8)) - expect(result.current.infosCaclucation).toStrictEqual([ + expect(result.current.infosCalculation).toStrictEqual([ { firstUnit: '9', total: 0, diff --git a/src/hooks/plans/useGraduatedChargeForm.ts b/src/hooks/plans/useGraduatedChargeForm.ts index 715812ea3..4b971f2ec 100644 --- a/src/hooks/plans/useGraduatedChargeForm.ts +++ b/src/hooks/plans/useGraduatedChargeForm.ts @@ -31,7 +31,7 @@ type UseGraduatedChargeForm = ({ addRange: () => void deleteRange: (rangeIndex: number) => void tableDatas: RangeType[] - infosCaclucation: InfoCalculationRow[] + infosCalculation: InfoCalculationRow[] } export const DEFAULT_GRADUATED_CHARGES = [ @@ -79,7 +79,7 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({ }), [graduatedRanges, disabled] ), - infosCaclucation: useMemo( + infosCalculation: useMemo( () => graduatedRanges.reduce((acc, range, i) => { const units =