-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
WIP - Adding radio buttons for occupancy attributes
The main functionality seems to be working and should be a case of tidying up the types, adding tests and modify existing tests to pass
- Loading branch information
Showing
7 changed files
with
81 additions
and
44 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
15 changes: 15 additions & 0 deletions
15
server/testutils/factories/bedspaceSearchFormParameters.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
import { fakerEN_GB as faker } from '@faker-js/faker' | ||
import { Factory } from 'fishery' | ||
|
||
import { BedspaceSearchFormParameters, OccupancyAttribute } from '../../@types/ui' | ||
import { DateFormats } from '../../utils/dateUtils' | ||
import referenceData from './referenceData' | ||
|
||
const occupancyAttributes: Array<OccupancyAttribute> = ['all', 'singleOccupancy', 'sharedProperty'] | ||
|
||
export default Factory.define<BedspaceSearchFormParameters>(() => ({ | ||
startDate: DateFormats.dateObjToIsoDate(faker.date.soon()), | ||
durationDays: faker.number.int({ min: 1, max: 10 }), | ||
probationDeliveryUnits: [referenceData.pdu().build().id, referenceData.pdu().build().id], | ||
occupancyAttribute: faker.helpers.arrayElement(occupancyAttributes), | ||
})) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters