Skip to content

Commit

Permalink
PEK-902 Del2: Fikset slik at felt tillater punktum og komma
Browse files Browse the repository at this point in the history
  • Loading branch information
martinstorvoll committed Dec 19, 2024
1 parent 23cd28a commit ffcdce0
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
8 changes: 3 additions & 5 deletions src/utils/__tests__/inntekt.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/utils/inntekt.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down

0 comments on commit ffcdce0

Please sign in to comment.