Skip to content

Commit

Permalink
chore: fix variable typo
Browse files Browse the repository at this point in the history
  • Loading branch information
ansmonjol committed Aug 16, 2023
1 parent 414b3e4 commit ad56dc9
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 19 deletions.
6 changes: 3 additions & 3 deletions src/components/plans/GraduatedChargeTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ export const GraduatedChargeTable = ({
}: GraduatedChargeTableProps) => {
const { translate } = useInternationalization()
const [errorIndex, setErrorIndex] = useState<number | undefined>()
const { tableDatas, addRange, handleUpdate, deleteRange, infosCaclucation } =
const { tableDatas, addRange, handleUpdate, deleteRange, infosCalculation } =
useGraduatedChargeForm({
chargeIndex,
disabled,
Expand Down Expand Up @@ -214,7 +214,7 @@ export const GraduatedChargeTable = ({

<Alert type="info">
<>
{infosCaclucation.map((calculation, i) => {
{infosCalculation.map((calculation, i) => {
if (i === 0) {
return (
<Typography variant="bodyHl" key={`calculation-alert-${i}`} color="textSecondary">
Expand All @@ -230,7 +230,7 @@ export const GraduatedChargeTable = ({
)
}
if (i === 1) {
return infosCaclucation.length === 2 ? (
return infosCalculation.length === 2 ? (
<Typography key={`calculation-alert-${i}`} color="textSecondary">
{translate('text_64cac576a11db000acb130b2', {
tier1LastUnit: ONE_TIER_EXAMPLE_UNITS,
Expand Down
28 changes: 14 additions & 14 deletions src/hooks/plans/__tests__/useGraduatedChargeForm.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -147,7 +147,7 @@ describe('useGraduatedRange()', () => {
disabledDelete: false,
},
])
expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '4',
total: 0,
Expand Down Expand Up @@ -199,7 +199,7 @@ describe('useGraduatedRange()', () => {
},
])

expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '2',
total: 9,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -300,7 +300,7 @@ describe('useGraduatedRange()', () => {
disabledDelete: false,
},
])
expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '5',
total: 0,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -464,7 +464,7 @@ describe('useGraduatedRange()', () => {
disabledDelete: false,
},
])
expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '4',
total: 0,
Expand Down Expand Up @@ -516,7 +516,7 @@ describe('useGraduatedRange()', () => {
},
])

expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '2',
total: 9,
Expand All @@ -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,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -617,7 +617,7 @@ describe('useGraduatedRange()', () => {
disabledDelete: false,
},
])
expect(result.current.infosCaclucation).toStrictEqual([
expect(result.current.infosCalculation).toStrictEqual([
{
firstUnit: '5',
total: 0,
Expand All @@ -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,
Expand Down
4 changes: 2 additions & 2 deletions src/hooks/plans/useGraduatedChargeForm.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ type UseGraduatedChargeForm = ({
addRange: () => void
deleteRange: (rangeIndex: number) => void
tableDatas: RangeType[]
infosCaclucation: InfoCalculationRow[]
infosCalculation: InfoCalculationRow[]
}

export const DEFAULT_GRADUATED_CHARGES = [
Expand Down Expand Up @@ -79,7 +79,7 @@ export const useGraduatedChargeForm: UseGraduatedChargeForm = ({
}),
[graduatedRanges, disabled]
),
infosCaclucation: useMemo(
infosCalculation: useMemo(
() =>
graduatedRanges.reduce<InfoCalculationRow[]>((acc, range, i) => {
const units =
Expand Down

0 comments on commit ad56dc9

Please sign in to comment.