-
Notifications
You must be signed in to change notification settings - Fork 4
[PB-5590] test(user): add E2E tests for user registration flow #840
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
base: master
Are you sure you want to change the base?
Conversation
fb00272 to
5cc6946
Compare
5cc6946 to
1f4453a
Compare
| keys: { | ||
| ecc: { | ||
| publicKey: `ecc-public-key-test-${uniqueId}`, | ||
| privateKey: `ecc-private-key-test-${uniqueId}`, | ||
| revocationKey: `ecc-revocation-key-test-${uniqueId}`, | ||
| }, | ||
| kyber: { | ||
| publicKey: `kyber-public-key-test-${uniqueId}`, | ||
| privateKey: `kyber-private-key-test-${uniqueId}`, | ||
| }, | ||
| }, | ||
| ...overrides, | ||
| }; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Generate one key using the libraries if possible. Just to prevent any issue if we add a validation in the DTOs for the keys.
Just if possible, of course. I think we have the libraries to create keys already in the repository check the preCreated code to confirm. However, I feel we can merge this like this, you would need to create a tech debt ticket to tackle it later
Up to you @jzunigax2
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I decided to implement it now using the existing libraries (openpgp for ECC and @dashlane/pqc-kem-kyber512-node for Kyber) to avoid creating tech debt and get it right from the start.
|



This PR adds end-to-end tests for the user registration endpoint (POST /users).
The tests cover three main scenarios: successful registration with valid data, rejection of invalid registration attempts (missing fields, invalid email format, duplicate email, field length limits), and verification that all user resources are created correctly after registration.
Additionally, mocks were added to test-app.helper for external services (MailerService, NewsletterService, NotificationListener) to prevent E2E tests from making real API calls to external services.