111 Add Endpoints E2E Tests Phase 1 #114
Merged
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.
What is this PR and why do we need it?
This PR aims to enhance the test coverage within the SDKs by adding tests to check endpoint behaviors across various authentication states. The tests cover scenarios for unauthenticated users, authenticated users, and post-logout behaviors, ensuring that cookies are correctly set and removed, endpoints are performing their required interactions with the FA API based on simulated real user interactions with the UI.
Changes Made
Added tests for
GET /app/me
app.at
cookie./app/me
endpoint with the authentication token.application/json
and the response is successful.Added tests for
GET /app/logout
/app/logout
endpoint and ensures a302
status redirect to/oauth2/logout
.Added tests for
GET /app/login
/app/login
endpoint and ensures a302
status redirect to/oauth2/authorize
.redirect_uri
is encoded and saved to the state, redirecting to/app/callback
.Testing
To test these changes:
SERVER_COMMAND='' PORT= yarn test:e2e
to run the end-to-end tests.#111
Pre-Merge Checklist (if applicable)
[x] Unit and Feature tests have been added/updated for logic changes, or there is a justifiable reason for not doing so.