-
Notifications
You must be signed in to change notification settings - Fork 448
feat: poc integration tests for identities management express.js samples #2389
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?
feat: poc integration tests for identities management express.js samples #2389
Conversation
…n and signup tests
3729456 to
4c2f3ab
Compare
…-integration-tests
zepatrik
left a comment
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.
While the overall approach looks good, I'm thinking whether it makes more sense to have everything in one file. What you have is a bit more boilerplate (passing the SDK and exporting again), while the reader might want to have everything in one file in the end when copy-pasting. The current content is meant to be all in one file, while yours is meant to be split up. I'm pretty sure you can cut the code up into sections and only show parts of it for each code box. WDYT?
docs/identities/get-started/_common/code-examples/js/sign-up.js
Outdated
Show resolved
Hide resolved
While a single-file approach works for copy-paste, the modular approach serves both documentation and testing. We can show focused snippets in docs, and integration tests require combining multiple unrelated samples in one server. Splitting into modules lets us:
@unatasha8 You may want to give your opinion on this? |
…-integration-tests
This PoC introduces integration tests for Ory Identity session management flows, ensuring that the code examples in our documentation work correctly end-to-end.
The tests run against a test Express.js server that directly imports and uses code examples from the documentation.
While the tests use Ory's self-service API for login (via
selfServiceLogin()utility), they validate the complete end-to-end flows for:Logout Flow: After authenticating via self-service API, the tests verify that the logout endpoint in the example app correctly handles session termination and redirects appropriately.
Session Management Flow: Tests verify that authenticated sessions can be retrieved and validated through the example app's session endpoints.
Tests run in GitHub Actions with secrets injected for:
ORY_SDK_URL- Ory test account endpoint URLTEST_USER_EMAIL- Test user credentialsTEST_USER_PASSWORD- Test user credentialsChecklist
If this pull request addresses a security vulnerability,
I confirm that I got approval (please contact security@ory.com) from the maintainers to push the changes.
Further comments