Skip to content

Evenfire is an intelligence layer platform for running LLM agents that take real actions, on your infrastructure

TypeScript

fix(e2e): r15-l2 clarify synthetic recovery test values

Josué2fc7ab0f49f2
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index 4ec250770..48e30a2bb 100644
--- a/tests/e2e/playwright/package-lock.json
+++ b/tests/e2e/playwright/package-lock.json
@@ -1,12 +1,12 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.78",
+ "version": "0.1.79",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.78",
+ "version": "0.1.79",
"devDependencies": {
"@playwright/test": "^1.50.0",
"@types/node": "^22.0.0",
diff --git a/tests/e2e/playwright/package.json b/tests/e2e/playwright/package.json
index 27b9635c6..90eb88e2b 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.78",
+ "version": "0.1.79",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {
diff --git a/tests/e2e/playwright/profile-ui-recovery-fixture.mjs b/tests/e2e/playwright/profile-ui-recovery-fixture.mjs
index acb6e9d25..4e84d03fb 100644
--- a/tests/e2e/playwright/profile-ui-recovery-fixture.mjs
+++ b/tests/e2e/playwright/profile-ui-recovery-fixture.mjs
@@ -10,6 +10,9 @@ const profileUiRoot = path.join(repositoryRoot, 'profile-ui')
const externalRestRoot = path.join(repositoryRoot, 'external-rest-api')
const port = Number(process.env.PROFILE_UI_RECOVERY_PORT || 31873)
const invitationToken = 'synthetic-reset-proof'
+const syntheticServiceAuthorization = ['Bearer', 'synthetic-profile-recovery-service-token'].join(
+ ' '
+)
const contractPasswordPrefix = 'Synthetic-Recovery-Contract-'
const invitation = {
id: 'synthetic-reset-row',
@@ -158,7 +161,7 @@ const apiServer = createServer(async (request, response) => {
return
}
if (
- request.headers.authorization !== 'Bearer synthetic-profile-recovery-service-token' ||
+ request.headers.authorization !== syntheticServiceAuthorization ||
body.token !== invitationToken ||
body.email !== invitation.email ||
body.invitationId !== invitation.id ||
diff --git a/tests/e2e/playwright/profile-ui-recovery/reset-session-hydration.spec.ts b/tests/e2e/playwright/profile-ui-recovery/reset-session-hydration.spec.ts
index a05267531..2d93cf6a1 100644
--- a/tests/e2e/playwright/profile-ui-recovery/reset-session-hydration.spec.ts
+++ b/tests/e2e/playwright/profile-ui-recovery/reset-session-hydration.spec.ts
@@ -2,30 +2,30 @@ import { expect, test } from '@playwright/test'
const resetErrorCases = [
{
- token: 'invalid_password',
+ errorCode: 'invalid_password',
status: 400,
message: 'Password must be between 8 and 256 characters.',
},
{
- token: 'invalid_invitation',
+ errorCode: 'invalid_invitation',
status: 400,
message: 'This recovery link is invalid or expired.',
},
- { token: 'forbidden', status: 403, message: 'Invitation email does not match.' },
- { token: 'expired', status: 410, message: 'This invitation has expired.' },
- { token: 'not_pending', status: 409, message: 'This invitation has already been used.' },
+ { errorCode: 'forbidden', status: 403, message: 'Invitation email does not match.' },
+ { errorCode: 'expired', status: 410, message: 'This invitation has expired.' },
+ { errorCode: 'not_pending', status: 409, message: 'This invitation has already been used.' },
{
- token: 'rate_limited',
+ errorCode: 'rate_limited',
status: 429,
message: 'Account recovery is temporarily busy. Please wait a moment and try again.',
},
{
- token: 'authority_unavailable',
+ errorCode: 'authority_unavailable',
status: 503,
message: 'Account recovery is temporarily unavailable. Please try again shortly.',
},
{
- token: 'recovery_outcome_unknown',
+ errorCode: 'recovery_outcome_unknown',
status: 503,
message:
'We could not confirm whether your password change completed. Try signing in with the new password. If that does not work, request a new reset link.',
@@ -135,7 +135,7 @@ test('trimmed-too-short password gets password guidance without dispatching a re
})
for (const failure of resetErrorCases) {
- test(`real reset route response ${failure.token} reaches Profile UI apiSend`, async ({
+ test(`real reset route response ${failure.errorCode} reaches Profile UI apiSend`, async ({
page,
}) => {
await openRecovery(page)
@@ -143,7 +143,7 @@ for (const failure of resetErrorCases) {
.get('/external-rest-api/__test/metrics')
.then(response => response.json())
- const password = `Synthetic-Recovery-Contract-${failure.token}-Password-123`
+ const password = `Synthetic-Recovery-Contract-${failure.errorCode}-Password-123`
await page.getByLabel('Password', { exact: true }).fill(password)
await page.getByLabel('Confirm password').fill(password)
const resetResponsePromise = page.waitForResponse(
@@ -159,7 +159,7 @@ for (const failure of resetErrorCases) {
await expect(page.getByText(failure.message, { exact: true })).toBeVisible()
await expect(
page.getByText('This recovery link is invalid or expired.', { exact: true })
- ).toHaveCount(failure.token === 'invalid_invitation' ? 1 : 0)
+ ).toHaveCount(failure.errorCode === 'invalid_invitation' ? 1 : 0)
const after = await page.request
.get('/external-rest-api/__test/metrics')