Skip to content

Commit

Permalink
Add tests
Browse files Browse the repository at this point in the history
  • Loading branch information
oddsson committed Dec 19, 2024
1 parent 22af2b7 commit 0b7a452
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions apps/judicial-system/web/src/utils/validate.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import faker from 'faker'

import { isTrafficViolationStepValidIndictments, validate } from './validate'
import {
Case,
IndictmentCountOffense,
IndictmentSubtype,
} from '../graphql/schema'
import { getLegalArguments } from '../routes/Prosecutor/Indictments/Indictment/IndictmentCount'
import { isTrafficViolationStepValidIndictments, validate } from './validate'

describe('Validate police casenumber format', () => {
test('should fail if not in correct form', () => {
Expand Down Expand Up @@ -348,8 +347,8 @@ describe('isTrafficViolationStepValidIndictments', () => {
hasCivilClaims: true,
civilDemands: faker.lorem.sentence(),
indictmentSubtypes: {
['1234']: [IndictmentSubtype.TRAFFIC_VIOLATION],
['5678']: [IndictmentSubtype.TRAFFIC_VIOLATION],
'1234': [IndictmentSubtype.TRAFFIC_VIOLATION],
'5678': [IndictmentSubtype.TRAFFIC_VIOLATION],
},
indictmentCounts: [
{
Expand Down Expand Up @@ -384,8 +383,8 @@ describe('isTrafficViolationStepValidIndictments', () => {
hasCivilClaims: true,
civilDemands: faker.lorem.sentence(),
indictmentSubtypes: {
['1234']: [IndictmentSubtype.TRAFFIC_VIOLATION],
['5678']: [IndictmentSubtype.TRAFFIC_VIOLATION],
'1234': [IndictmentSubtype.TRAFFIC_VIOLATION],
'5678': [IndictmentSubtype.TRAFFIC_VIOLATION],
},
indictmentCounts: [
{
Expand Down Expand Up @@ -420,8 +419,8 @@ describe('isTrafficViolationStepValidIndictments', () => {
hasCivilClaims: true,
civilDemands: faker.lorem.sentence(),
indictmentSubtypes: {
['1234']: [IndictmentSubtype.BODILY_INJURY],
['5678']: [
'1234': [IndictmentSubtype.BODILY_INJURY],
'5678': [
IndictmentSubtype.TRAFFIC_VIOLATION,
IndictmentSubtype.AGGRAVATED_ASSAULT,
],
Expand Down

0 comments on commit 0b7a452

Please sign in to comment.