Skip to content

Commit

Permalink
Fix cypress tests
Browse files Browse the repository at this point in the history
  • Loading branch information
louptheron committed Jan 23, 2025
1 parent e55ff69 commit e2bd35f
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -433,6 +433,11 @@ context('Side Window > Manual Prior Notification Form > Form', () => {

cy.fill('Engins utilisés', ['OTB'], { index: 1 })

const { utcDateTupleWithTime: arrivalDateTupleWithTime } =
getUtcDateInMultipleFormats(customDayjs().add(2, 'hours').startOf('minute').toISOString())
cy.fill("Date et heure estimées d'arrivée au port (UTC)", arrivalDateTupleWithTime)
cy.fill("équivalentes à celles de l'arrivée au port", true)

cy.wait('@computePriorNotification')
cy.countRequestsByAlias('@computePriorNotification').should('be.equal', 1)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,7 +82,7 @@ context('Side Window > Mission Form > Sea Control Edition', () => {
otherComments: 'Commentaires post contrôle',
otherInfractions: [],
portLocode: null,
segments: [{ segment: 'SWW04', segmentName: 'SWW04' }],
segments: [],
seizureAndDiversion: false,
seizureAndDiversionComments: null,
separateStowageOfPreservedSpecies: 'NO',
Expand Down Expand Up @@ -179,12 +179,7 @@ context('Side Window > Mission Form > Sea Control Edition', () => {
otherComments: 'Commentaires post contrôle',
otherInfractions: [],
portLocode: null,
segments: [
{
segment: 'SWW02',
segmentName: 'SWW02'
}
],
segments: [],
seizureAndDiversion: false,
seizureAndDiversionComments: null,
separateStowageOfPreservedSpecies: 'NO',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,19 @@ import { INITIAL_FORM_VALUES } from './constants'
import type { ManualPriorNotificationFormValues, ManualPriorNotificationFormValuesFishingCatch } from './types'

export function getPartialComputationRequestData({
expectedArrivalDate,
expectedLandingDate,
fishingCatches,
globalFaoArea,
isExpectedLandingDateSameAsExpectedArrivalDate,
portLocode,
tripGearCodes,
vesselIdentity
}: ManualPriorNotificationFormValues) {
const year = expectedLandingDate ? customDayjs(expectedLandingDate).get('year') : undefined
const computedExpectedLandingDate = isExpectedLandingDateSameAsExpectedArrivalDate
? expectedArrivalDate
: expectedLandingDate
const year = computedExpectedLandingDate ? customDayjs(computedExpectedLandingDate).get('year') : undefined

return {
fishingCatches,
Expand Down

0 comments on commit e2bd35f

Please sign in to comment.