From 28b9dc538cbdf97e4a749a2824499d9dad1d3b47 Mon Sep 17 00:00:00 2001 From: Marion Hauff Date: Thu, 19 Dec 2024 10:01:19 +0100 Subject: [PATCH 1/2] teknisk gjeld: renamer css selector med lite forbokstav --- .../RedigerAvansertBeregning.test.tsx.snap | 2 +- src/components/common/Divider/Divider.module.scss | 4 ++-- .../common/Divider/Divider.module.scss.d.ts | 12 ++++++------ src/components/common/Divider/Divider.tsx | 4 ++-- .../__tests__/__snapshots__/Divider.test.tsx.snap | 2 +- 5 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap b/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap index 9b7cc67d7..670d37eef 100644 --- a/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap +++ b/src/components/RedigerAvansertBeregning/__tests__/__snapshots__/RedigerAvansertBeregning.test.tsx.snap @@ -353,7 +353,7 @@ exports[`RedigerAvansertBeregning > Gitt at en bruker har vedtak om alderspensjo
= ({ smallMargin, noMargin }) => { return (
) diff --git a/src/components/common/Divider/__tests__/__snapshots__/Divider.test.tsx.snap b/src/components/common/Divider/__tests__/__snapshots__/Divider.test.tsx.snap index 9b89337bf..32d0ee6bf 100644 --- a/src/components/common/Divider/__tests__/__snapshots__/Divider.test.tsx.snap +++ b/src/components/common/Divider/__tests__/__snapshots__/Divider.test.tsx.snap @@ -11,7 +11,7 @@ exports[`Divider > rendrer riktig med default verdier 1`] = ` exports[`Divider > rendrer riktig uten margin 1`] = `
`; From ffcdce0a356348e42fd48ab41a65dac372a5690b Mon Sep 17 00:00:00 2001 From: martinstorvoll Date: Thu, 19 Dec 2024 22:11:58 +0100 Subject: [PATCH 2/2] PEK-902 Del2: Fikset slik at felt tillater punktum og komma --- src/utils/__tests__/inntekt.test.ts | 8 +++----- src/utils/inntekt.ts | 2 +- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/src/utils/__tests__/inntekt.test.ts b/src/utils/__tests__/inntekt.test.ts index 1ce99a2ea..7bd227aa2 100644 --- a/src/utils/__tests__/inntekt.test.ts +++ b/src/utils/__tests__/inntekt.test.ts @@ -276,13 +276,11 @@ describe('inntekt-utils', () => { ).toBeFalsy() expect( validateInntekt('-25', updateValidationErrorMessageMock) - ).toBeTruthy() - expect( - validateInntekt('-', updateValidationErrorMessageMock) - ).toBeTruthy() + ).toBeFalsy() + expect(validateInntekt('-', updateValidationErrorMessageMock)).toBeFalsy() expect( validateInntekt('123.43', updateValidationErrorMessageMock) - ).toBeTruthy() + ).toBeFalsy() expect(updateValidationErrorMessageMock).toHaveBeenNthCalledWith( 1, 'inntekt.endre_inntekt_modal.textfield.validation_error.type' diff --git a/src/utils/inntekt.ts b/src/utils/inntekt.ts index 07bacf48b..9b4d22b3b 100644 --- a/src/utils/inntekt.ts +++ b/src/utils/inntekt.ts @@ -47,7 +47,7 @@ export const validateInntekt = ( return isValid } - if (!/^[0-9\s\-.]+$/.test(input)) { + if (!/^[0-9\s]+$/.test(input)) { isValid = false if (updateValidationErrorMessage) { updateValidationErrorMessage(