Skip to content

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

TypeScript

test: require mandatory recovery cases for R18-L1

Josué9516ae092676
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index a4822028a..3e4214b49 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.82",
+ "version": "0.1.83",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.82",
+ "version": "0.1.83",
"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 e2b025e30..d3295d64a 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.82",
+ "version": "0.1.83",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {
diff --git a/tests/e2e/playwright/run-profile-ui-recovery.mjs b/tests/e2e/playwright/run-profile-ui-recovery.mjs
index 8bb4483b7..2885cfb78 100644
--- a/tests/e2e/playwright/run-profile-ui-recovery.mjs
+++ b/tests/e2e/playwright/run-profile-ui-recovery.mjs
@@ -5,6 +5,35 @@ import { fileURLToPath } from 'node:url'
const scriptDirectory = path.dirname(fileURLToPath(import.meta.url))
const config = path.join(scriptDirectory, 'profile-ui-recovery.config.ts')
const playwrightCli = path.join(scriptDirectory, 'node_modules/@playwright/test/cli.js')
+const requiredResetErrorCodes = [
+ 'invalid_password',
+ 'invalid_invitation',
+ 'forbidden',
+ 'expired',
+ 'not_pending',
+ 'rate_limited',
+ 'authority_unavailable',
+ 'recovery_outcome_unknown',
+ 'internal_error',
+ 'unknown_500',
+]
+const requiredTestTitles = [
+ 'member accepts the prepared invitation and establishes its own password',
+ 'accepted admin desktop invitation uses the token fallback without a prior session',
+ 'reset-only producer rejects an ordinary invitation without creating a session',
+ 'retries session hydration after committed reset without resubmitting the reset proof',
+ 'trimmed-too-short password gets password guidance without dispatching a reset',
+ ...requiredResetErrorCodes.map(
+ errorCode => `real reset route response ${errorCode} reaches Profile UI apiSend`
+ ),
+]
+
+function assertRequiredCases(output, phase) {
+ const missing = requiredTestTitles.filter(title => !output.includes(`› ${title}`))
+ if (missing.length > 0) {
+ throw new Error(`Profile UI recovery runner ${phase} required cases: ${missing.join('; ')}`)
+ }
+}
function runPlaywright(args) {
return spawnSync(process.execPath, [playwrightCli, 'test', '--config', config, ...args], {
@@ -25,9 +54,7 @@ if (!listingOutput.includes('reset-session-hydration.spec.ts')) {
if (!listingOutput.includes('ordinary-invitation-onboarding.spec.ts')) {
throw new Error('Profile UI recovery runner did not collect ordinary invitation onboarding')
}
-if (!/Total:\s*[1-9]\d* tests?\b/.test(listingOutput)) {
- throw new Error('Profile UI recovery runner collected zero tests')
-}
+assertRequiredCases(listingOutput, 'did not collect')
const run = runPlaywright(['--reporter=line'])
const runOutput = `${run.stdout || ''}${run.stderr || ''}`
@@ -45,6 +72,7 @@ for (const requiredSuite of [
throw new Error(`Profile UI recovery runner did not execute ${requiredSuite}`)
}
}
+assertRequiredCases(runOutput, 'did not execute')
if (/\b[1-9]\d* skipped\b/.test(runOutput)) {
throw new Error('Profile UI recovery runner skipped a required test')
}