Skip to content

Commit

Permalink
WIP commit to clean up type errors
Browse files Browse the repository at this point in the history
  • Loading branch information
brimchugh committed Dec 2, 2024
1 parent 080ee55 commit 5644aa1
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 5 deletions.
3 changes: 2 additions & 1 deletion cypress_shared/helpers/place.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import BookingNewPage from '../pages/temporary-accommodation/manage/bookingNew'
import BookingSelectAssessmentPage from '../pages/temporary-accommodation/manage/bookingSelectAssessment'
import BookingShowPage from '../pages/temporary-accommodation/manage/bookingShow'
import { characteristicsToSearchAttributes } from '../utils/bedspaceSearch'
import { OccupancyAttribute } from '../../server/@types/ui/index';

Check warning on line 27 in cypress_shared/helpers/place.ts

View workflow job for this annotation

GitHub Actions / Linting 🔎

'OccupancyAttribute' is defined but never used

Check failure on line 27 in cypress_shared/helpers/place.ts

View workflow job for this annotation

GitHub Actions / Linting 🔎

'/home/runner/work/hmpps-temporary-accommodation-ui/hmpps-temporary-accommodation-ui/server/@types/ui/index.d.ts' imported multiple times

Check failure on line 27 in cypress_shared/helpers/place.ts

View workflow job for this annotation

GitHub Actions / Linting 🔎

Delete `;`

export default class PlaceHelper {
private readonly bedSearchResults: BedSearchResults
Expand Down Expand Up @@ -109,7 +110,7 @@ export default class PlaceHelper {
attributes: characteristicsToSearchAttributes(this.premises),
})

bedspaceSearchPage.completeForm(searchParameters)
bedspaceSearchPage.completeForm(searchParameters);

Check failure on line 113 in cypress_shared/helpers/place.ts

View workflow job for this annotation

GitHub Actions / Type check 🔎

Argument of type 'TemporaryAccommodationBedSearchParameters' is not assignable to parameter of type 'BedspaceSearchFormParameters'.

Check failure on line 113 in cypress_shared/helpers/place.ts

View workflow job for this annotation

GitHub Actions / Linting 🔎

Delete `;`
bedspaceSearchPage.clickSubmit()

// I am taken to the search results page
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,7 @@ context('Bedspace Search', () => {
cy.task('stubBooking', { premisesId: premises.id, booking })

// And when I fill out the form
const searchParameters = BedspaceSearchFormParametersFactory.build()
const searchParameters = bedspaceSearchFormParametersFactory.build()
preSearchPage.completeForm(searchParameters)
preSearchPage.clickSubmit()

Expand Down Expand Up @@ -237,7 +237,7 @@ context('Bedspace Search', () => {
const results = bedSearchResultsFactory.build()
cy.task('stubBedSearch', results)

const searchParameters = BedspaceSearchFormParametersFactory.build()
const searchParameters = bedspaceSearchFormParametersFactory.build()
preSearchPage.completeForm(searchParameters)
preSearchPage.clickSubmit()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,9 @@ type APISearchQuery = Omit<BedspaceSearchFormParameters, 'occupancyAttribute'> &
/**
* The number of days the Bed will need to be free from the start_date until
*/
durationDays: string
startDate: string
durationDays: number
probationDeliveryUnits: string[]
}

export default class BedspaceSearchController {
Expand Down Expand Up @@ -59,8 +61,13 @@ export default class BedspaceSearchController {

try {
if (apiQueryParams) {

const startDateParam: ObjectWithDateParts<"startDate"> = {
startDate: apiQueryParams.startDate
}

startDate = DateFormats.dateAndTimeInputsToIsoString(
apiQueryParams as ObjectWithDateParts<'startDate'>,
startDateParam,
'startDate',
).startDate

Expand Down

0 comments on commit 5644aa1

Please sign in to comment.