Skip to content

Commit

Permalink
Introduce summaryData test fixture
Browse files Browse the repository at this point in the history
We want to be able to check for the presence of data we extract from the
`summaryData` object in our integeration & e2e tests. This commit adds a
test fixture for this data.
  • Loading branch information
libuk committed Sep 20, 2023
1 parent 7abf806 commit 80fb541
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions cypress_shared/fixtures/summaryData.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"isAbleToShare": true,
"releaseType": "Custody"
}
3 changes: 2 additions & 1 deletion server/testutils/factories/assessment.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import { faker } from '@faker-js/faker/locale/en_GB'
import { Factory } from 'fishery'
import type { TemporaryAccommodationAssessment as Assessment } from '@approved-premises/api'

import summaryData from '../../../cypress_shared/fixtures/summaryData.json'
import { DateFormats } from '../../utils/dateUtils'
import { fakeObject } from '../utils'
import applicationFactory from './application'
Expand All @@ -27,7 +28,7 @@ class AssessmentFactory extends Factory<Assessment> {
export default AssessmentFactory.define(() => ({
id: faker.string.uuid(),
application: applicationFactory.withReleaseDate().build(),
summaryData: fakeObject(),
summaryData: summaryData,
allocatedToStaffMemberId: faker.string.uuid(),
schemaVersion: faker.string.uuid(),
outdatedSchema: false,
Expand Down

0 comments on commit 80fb541

Please sign in to comment.