fix(journey-suites): use mock API for otp-register e2e test#595
Conversation
The test hit the real backend (openam-sdks.forgeblocks.com/TEST_OTPRegistration) but a TODO indicated it should migrate to the mock once support landed. The mock now has qrCodeCallbacksResponse for the QRCodeTest journey, so switching removes the hidden dependency on a shared sandbox and makes the test deterministic. This unblocks every PR currently failing this same test. Also switch the messageArray assertion from .includes (exact) to .some + substring — the QR component logs the message wrapped in JSON, so an exact match on the bare message string never worked once rendering moved through renderQRCodeStep.
|
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📝 WalkthroughWalkthroughThe e2e test for OTP registration was updated to navigate to a Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
View your CI Pipeline Execution ↗ for commit a250b8c
☁️ Nx Cloud last updated this comment at |
@forgerock/davinci-client
@forgerock/device-client
@forgerock/journey-client
@forgerock/oidc-client
@forgerock/protect
@forgerock/sdk-types
@forgerock/sdk-utilities
@forgerock/iframe-manager
@forgerock/sdk-logger
@forgerock/sdk-oidc
@forgerock/sdk-request-middleware
@forgerock/storage
commit: |
|
Deployed 5d53299 to https://ForgeRock.github.io/ping-javascript-sdk/pr-595/5d53299e6c81e5243790e0e32b4062b11392075f branch gh-pages in ForgeRock/ping-javascript-sdk |
📦 Bundle Size Analysis📦 Bundle Size Analysis🚨 Significant Changes🔻 @forgerock/device-client - 0.0 KB (-9.9 KB, -100.0%) 📊 Minor Changes📉 @forgerock/device-client - 9.9 KB (-0.0 KB) ➖ No Changes➖ @forgerock/davinci-client - 48.0 KB 14 packages analyzed • Baseline from latest Legend🆕 New package ℹ️ How bundle sizes are calculated
🔄 Updated automatically on each push to this PR |
Summary
e2e/journey-suites/src/otp-register.test.tswas hitting the real backend atopenam-sdks.forgeblocks.com(clientId=tenant+journey=TEST_OTPRegistration). A TODO in the test signalled it should migrate to the mock API once OTP support landed. That landed (qrCodeCallbacksResponsefor theQRCodeTestjourney), but the test was never migrated.The shared sandbox account / journey state on
openam-sdks.forgeblocks.comno longer authenticatessdkuser/passwordforTEST_OTPRegistration— the auth flow loops back to the username/password form instead of advancing to the QR step. As a result, every PR opened or pushed since the underlying state changed has been failing this test, blocking CI for unrelated work.Changes
?journey=QRCodeTest(defaultbasicconfig → local mock atlocalhost:9443), aligning withqr-code.test.ts.messageArrayassertion from.includes()(exact match) to.some(msg => msg.includes(...))(substring) — the QR-code component logs the message wrapped in JSON viaconsole.log('QR Code data:', JSON.stringify(qrCodeData)), so the exact-string match never worked once rendering moved throughrenderQRCodeStep.// TODO: Use when AM Mock API is availablecomment.Verification
nx run @forgerock/journey-suites:e2e-ci--src/otp-register.test.ts— passes locally (17s).nx typecheck @forgerock/journey-suites— clean.nx lint @forgerock/journey-suites— clean.Test plan
Summary by CodeRabbit