Skip to content
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

test: remove stubClient and use mock server for eori and tva #1393

Merged
merged 4 commits into from
Nov 26, 2024

Conversation

rmonnier9
Copy link
Contributor

@rmonnier9 rmonnier9 commented Nov 21, 2024

  • Amélioration technique.
  • Détails :
    • Suppression des stubs
    • Ajout d'un mock serveur qui interceptent des requêtes déclarées dans un fichier

Closes #1401

@rmonnier9 rmonnier9 marked this pull request as ready for review November 21, 2024 14:32
@rmonnier9
Copy link
Contributor Author

rmonnier9 commented Nov 21, 2024

This PR does one first thing.

Some of the clients are used on the client.
For this case, Cypress is directly able to intercept the request in the browser, based on the url.
To do that, we also had to change the snapshot in order to get the raw response from the external API.

@XavierJp XavierJp marked this pull request as draft November 22, 2024 14:09
@XavierJp
Copy link
Contributor

Priority :

  • TVA
  • RechercheEntreprise (Siren, siret et recherche txt)
  • Insee siren
  • Insee siret
  • RNA

@XavierJp
Copy link
Contributor

https://hono.dev/

@XavierJp
Copy link
Contributor

Exigence :

  • facile à comprendre
  • facile de savoir ce qui est stubbé
  • séparation of concern dans le code (il ne faut avoir du code de test au milieu du code de prod)
  • séparation of concern dans les rôles (ne pas avoir un meme code pour générer les snapshots et pour stubber)

@rmonnier9
Copy link
Contributor Author

  • fichier qui permet en un clin d'oeil de savoir tout ce qui est stubbé (pattern matching)

@rmonnier9 rmonnier9 marked this pull request as ready for review November 25, 2024 15:31
@rmonnier9 rmonnier9 changed the title test: remove stub for bodacc, joafe and dca test: remove stubClient and use mock server for eori and tva Nov 25, 2024
@rmonnier9 rmonnier9 merged commit d597705 into main Nov 26, 2024
8 checks passed
@rmonnier9 rmonnier9 deleted the use-cypress-stub branch November 26, 2024 14:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove stub with cypress
2 participants