111 Add Endpoints E2E Tests Phase 2 #118
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/register
/app/register
endpoint and ensures that it triggers a302
status redirect to the/oauth2/register
endpoint.redirect_uri
is encoded and saved, redirecting to/app/callback
.Added tests for
POST /app/refresh
app.rt
,app.at
, andapp.at_exp
cookies.POST
request to the/app/refresh/{clientId}
endpoint using the authentication token and refresh token found in the cookies.200
.app.at_exp
cookie value has been updated (indicating a refreshed token) and is not equal to the original expiration time.app.at_exp
cookie is set in the browser context.Added tests for Baseline Authentication
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.