Skip to content

Commit

Permalink
fix(backend): fix unit test for interactions
Browse files Browse the repository at this point in the history
  • Loading branch information
pYassine committed Jul 26, 2024
1 parent 5d513e8 commit d56c9aa
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,14 +67,19 @@ describe("interactionsCreator", () => {
structureId: 1,
});

// Reset les courriers
usager.lastInteraction = {
dateInteraction: new Date(MOCKED_LAST_INTERACTION_DATE),
enAttente: false,
courrierIn: 0,
recommandeIn: 0,
colisIn: 0,
};
await usagerRepository.update(
{ uuid: usager.uuid },
{
lastInteraction: {
dateInteraction: new Date(MOCKED_LAST_INTERACTION_DATE),
enAttente: false,
courrierIn: 0,
recommandeIn: 0,
colisIn: 0,
},
}
);
usager = await usagerRepository.findOneBy({ uuid: usager.uuid });

// Usager pour tester le "npai"
await usagerRepository.update(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -279,13 +279,14 @@ export class UsagersController {
@Param("usagerRef", new ParseIntPipe()) _usagerRef: number,
@CurrentUsager() currentUsager: Usager
): Promise<Usager> {
currentUsager.etapeDemande = etapeDemande;
await usagerRepository.update(
{ uuid: currentUsager.uuid },
{
etapeDemande,
}
);
return { ...currentUsager, etapeDemande };
return currentUsager;
}

@UseGuards(UsagerAccessGuard)
Expand Down

0 comments on commit d56c9aa

Please sign in to comment.