Skip to content

Commit a250b8c

Browse files
committed
fix(journey-suites): use mock API for otp-register e2e test
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.
1 parent b081582 commit a250b8c

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

e2e/journey-suites/src/otp-register.test.ts

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ import { username, password } from './utils/demo-user.js';
1111

1212
test('Test happy paths on test page', async ({ page }) => {
1313
const { clickButton, navigate } = asyncEvents(page);
14-
await navigate('/?journey=TEST_OTPRegistration&clientId=tenant');
14+
await navigate('/?journey=QRCodeTest');
1515

1616
const messageArray: string[] = [];
1717

@@ -30,16 +30,10 @@ test('Test happy paths on test page', async ({ page }) => {
3030

3131
// Test assertions
3232
expect(
33-
messageArray.includes(
34-
'Scan the QR code image below with the ForgeRock Authenticator app to register your device with your login.',
33+
messageArray.some((msg) =>
34+
msg.includes(
35+
'Scan the QR code image below with the ForgeRock Authenticator app to register your device with your login.',
36+
),
3537
),
3638
).toBe(true);
37-
38-
// TODO: Use when AM Mock API is available
39-
// expect(
40-
// messageArray.includes(
41-
// 'otpauth://totp/ForgeRock:jlowery?secret=QITSTC234FRIU8DD987DW3VPICFY======&issuer=ForgeRock&period=30&digits=6&b=032b75',
42-
// ),
43-
// ).toBe(true);
44-
// expect(messageArray.includes('Basic login with OTP registration step successful')).toBe(true);
4539
});

0 commit comments

Comments
 (0)