Skip to content

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

TypeScript

fix(e2e): r6-l1 preserve valid navigation audit cases

Josué4b534452722a
diff --git a/tests/e2e/playwright/control-ui/auth.spec.ts b/tests/e2e/playwright/control-ui/auth.spec.ts
index 8675494f4..1f21951df 100644
--- a/tests/e2e/playwright/control-ui/auth.spec.ts
+++ b/tests/e2e/playwright/control-ui/auth.spec.ts
@@ -25,8 +25,7 @@ test.describe('Control UI — Auth', () => {
test('unauthenticated deep-link to a host detail page shows the login form, not host data', async ({
page,
}) => {
- // Negative route-guard: a direct visit to a protected entity route without
- // a session must land on the login form and must NOT leak host content.
+ // Negative route-guard: unauthenticated visit to a protected host detail.
await page.goto('/hosts/chatllm')
await expect(page.locator(CUI_AUTH.USERNAME_INPUT)).toBeVisible()
await expect(page.locator(CUI_AUTH.SIGN_IN_BUTTON)).toBeVisible()
diff --git a/tests/e2e/playwright/control-ui/codex-subscription-connection.spec.ts b/tests/e2e/playwright/control-ui/codex-subscription-connection.spec.ts
index 0b13d6b98..fe3b619af 100644
--- a/tests/e2e/playwright/control-ui/codex-subscription-connection.spec.ts
+++ b/tests/e2e/playwright/control-ui/codex-subscription-connection.spec.ts
@@ -78,6 +78,7 @@ test.describe('Codex subscription connection', () => {
})
test('J2 authenticated deep link and legacy redirect; unauth is AuthGate', async ({ page }) => {
+ // Negative deep-link guard: this protected page must stay at AuthGate.
await page.goto('/secrets/llm/subscriptions')
await expect(page.getByLabel('Username or email')).toBeVisible({ timeout: 20_000 })
await expect(page.getByRole('button', { name: 'Add subscription' })).toHaveCount(0)
diff --git a/tests/e2e/playwright/package-lock.json b/tests/e2e/playwright/package-lock.json
index c4450f5ce..2c505298d 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.73",
+ "version": "0.1.74",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "clerum-playwright-tests",
- "version": "0.1.73",
+ "version": "0.1.74",
"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 b74beb208..fcef23530 100644
--- a/tests/e2e/playwright/package.json
+++ b/tests/e2e/playwright/package.json
@@ -1,6 +1,6 @@
{
"name": "clerum-playwright-tests",
- "version": "0.1.73",
+ "version": "0.1.74",
"private": true,
"description": "Playwright E2E tests for Control UI and Desktop App",
"scripts": {
diff --git a/tools/e2e_static_audit.py b/tools/e2e_static_audit.py
index 0a82e468c..ae0ff22a2 100755
--- a/tools/e2e_static_audit.py
+++ b/tools/e2e_static_audit.py
@@ -59,6 +59,8 @@ def audit_text(text: str, path: Path = Path("<source>")) -> list[str]:
for match in re.finditer(r"\bpage\.goto\s*\(", text):
adjacent = _adjacent_line(text, match.start())
after = text[match.end() : match.end() + 160]
+ if re.match(r"\s*['\"]/?['\"]", after):
+ continue
if re.fullmatch(
r"\s*//\s*Negative (?:protected-route guard|route-guard|deep-link guard|"
r"legacy terminal-route guard):[^\n]*",
diff --git a/tools/test_e2e_static_audit_scope.py b/tools/test_e2e_static_audit_scope.py
index bd3113097..7d292aaa8 100644
--- a/tools/test_e2e_static_audit_scope.py
+++ b/tools/test_e2e_static_audit_scope.py
@@ -7,6 +7,12 @@ from tools.e2e_static_audit import audit_text
class E2EStaticAuditMarkerScopeTests(unittest.TestCase):
+ def test_plain_application_root_entry_remains_allowed(self) -> None:
+ source = "const response = page.waitForResponse(() => true)\npage.goto('/')"
+ self.assertFalse(
+ any("direct page.goto" in finding for finding in audit_text(source, Path("root.spec.ts")))
+ )
+
def test_marker_must_be_adjacent_to_its_navigation(self) -> None:
source = "// E2E_GUARDIAN_EMAIL_RESET_ENTRY_POINT\n\npage.goto('/invitations/reset-token')"
self.assertTrue(