-
Notifications
You must be signed in to change notification settings - Fork 10
fix(portail-usagers): fix conversion date dans inWithinInterval #3911
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from 2 commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
710e4aa
fix(portail-usagers): fix conversion date dans inWithinInterval
hbalty 0890f3d
feat(portail-usager): adding frontend unit tests
hbalty f9b556a
fix(backend): move controller tests to the right location
hbalty 88c75d4
feat(portail-usager): testing edge cases where server data is different
hbalty 1e2b916
fix(reviews): refactoring structureInformation class
hbalty ff9fb70
fix(backend): optional chaining
hbalty File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
66 changes: 66 additions & 0 deletions
66
packages/portail-usagers/src/_tests/mocks/PORTAIL_USAGER_PROFILE.mock.ts
This file contains hidden or 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,66 @@ | ||
import { PortailUsagerProfile, PortailUsagerPublic } from "@domifa/common"; | ||
|
||
const usager: PortailUsagerPublic = { | ||
uuid: "4dcdcddc-fad2-4827-aac5-0acf1df7b5bc", | ||
ref: 5, | ||
customRef: "5", | ||
structureId: 1, | ||
nom: "Derick", | ||
prenom: "Inspecteur", | ||
sexe: "homme", | ||
dateNaissance: new Date("1911-05-24T00:00:00.000Z"), | ||
villeNaissance: "Dreux", | ||
email: null, | ||
telephone: { | ||
numero: "", | ||
countryCode: "FR", | ||
}, | ||
contactByPhone: false, | ||
datePremiereDom: new Date("2025-08-13T00:00:00.000Z"), | ||
typeDom: "PREMIERE_DOM", | ||
decision: { | ||
uuid: "4328c843-e4bd-432d-b60b-b72a13ee3c9c", | ||
statut: "VALIDE", | ||
userId: 1, | ||
dateFin: new Date("2026-08-12T00:00:00.000Z"), | ||
userName: "Patrick Roméro", | ||
dateDebut: new Date("2025-08-13T00:00:00.000Z"), | ||
dateDecision: new Date("2025-08-13T14:29:36.624Z"), | ||
}, | ||
historique: [], | ||
ayantsDroits: [], | ||
lastInteraction: { | ||
colisIn: 0, | ||
enAttente: false, | ||
courrierIn: 0, | ||
recommandeIn: 0, | ||
dateInteraction: new Date("2025-08-13T00:00:00.000Z"), | ||
}, | ||
etapeDemande: 5, | ||
rdv: { | ||
userId: 2, | ||
dateRdv: new Date("2019-10-07T19:30:02.675Z"), | ||
userName: "Juste Isabelle", | ||
}, | ||
options: { | ||
transfert: { | ||
nom: "", | ||
dateDebut: null, | ||
dateFin: null, | ||
isExpired: false, | ||
adresse: null, | ||
actif: false, | ||
}, | ||
procurations: [], | ||
portailUsagerEnabled: true, | ||
npai: { | ||
actif: false, | ||
dateDebut: null, | ||
}, | ||
}, | ||
}; | ||
|
||
export const unProfilUsager: PortailUsagerProfile = { | ||
acceptTerms: new Date(), | ||
usager: usager, | ||
}; |
46 changes: 46 additions & 0 deletions
46
packages/portail-usagers/src/_tests/mocks/STRUCTURE_INFORMATION.mock.ts
This file contains hidden or 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,46 @@ | ||
import { StructureInformation } from "@domifa/common"; | ||
import { add, sub } from "date-fns"; | ||
|
||
export const unMessageCourant: StructureInformation = { | ||
uuid: "1", | ||
createdAt: new Date("2025-08-13T15:28:52.311Z"), | ||
updatedAt: new Date("2025-08-13T15:28:52.311Z"), | ||
version: 1, | ||
title: "Un message courant", | ||
description: "Un message", | ||
isTemporary: true, | ||
startDate: sub(new Date(), { | ||
days: 1, | ||
}), | ||
endDate: add(new Date(), { | ||
days: 1, | ||
}), | ||
type: "general", | ||
createdBy: { | ||
userId: 1, | ||
userName: "Patrick Roméro", | ||
}, | ||
structureId: 1, | ||
}; | ||
|
||
export const unMessagePasse: StructureInformation = { | ||
...unMessageCourant, | ||
title: "Un message passé", | ||
startDate: sub(new Date(), { | ||
days: 4, | ||
}), | ||
endDate: sub(new Date(), { | ||
days: 1, | ||
}), | ||
}; | ||
|
||
export const unMessageFutur: StructureInformation = { | ||
...unMessageCourant, | ||
title: "Un message futur", | ||
startDate: add(new Date(), { | ||
days: 2, | ||
}), | ||
endDate: add(new Date(), { | ||
days: 4, | ||
}), | ||
}; |
This file contains hidden or 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 hidden or 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
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.