From a250b8cce69299946e5fb3e0f8ada2b37fb838f1 Mon Sep 17 00:00:00 2001 From: Ryan Bas Date: Tue, 28 Apr 2026 15:36:34 -0600 Subject: [PATCH] fix(journey-suites): use mock API for otp-register e2e test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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. --- e2e/journey-suites/src/otp-register.test.ts | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/e2e/journey-suites/src/otp-register.test.ts b/e2e/journey-suites/src/otp-register.test.ts index e743d4301f..27f33ca373 100644 --- a/e2e/journey-suites/src/otp-register.test.ts +++ b/e2e/journey-suites/src/otp-register.test.ts @@ -11,7 +11,7 @@ import { username, password } from './utils/demo-user.js'; test('Test happy paths on test page', async ({ page }) => { const { clickButton, navigate } = asyncEvents(page); - await navigate('/?journey=TEST_OTPRegistration&clientId=tenant'); + await navigate('/?journey=QRCodeTest'); const messageArray: string[] = []; @@ -30,16 +30,10 @@ test('Test happy paths on test page', async ({ page }) => { // Test assertions expect( - messageArray.includes( - 'Scan the QR code image below with the ForgeRock Authenticator app to register your device with your login.', + messageArray.some((msg) => + msg.includes( + 'Scan the QR code image below with the ForgeRock Authenticator app to register your device with your login.', + ), ), ).toBe(true); - - // TODO: Use when AM Mock API is available - // expect( - // messageArray.includes( - // 'otpauth://totp/ForgeRock:jlowery?secret=QITSTC234FRIU8DD987DW3VPICFY======&issuer=ForgeRock&period=30&digits=6&b=032b75', - // ), - // ).toBe(true); - // expect(messageArray.includes('Basic login with OTP registration step successful')).toBe(true); });