v0.71.0: fix admin e2e — pass sessionId into page.evaluate
CI / build + unit + e2e (pull_request) Successful in 15m37s

This commit is contained in:
2026-09-24 09:56:05 +00:00
parent b89d351587
commit e24a5788c0
+3 -1
View File
@@ -34,7 +34,9 @@ test('admin panel: login form, wrong-creds error, session auth, DB grid CRUD, lo
// --- Authenticate via the test hook + localStorage, then reopen the panel.
const sessionId = await mintAdminSession(page);
await page.evaluate((key) => window.localStorage.setItem(key, sessionId), SESSION_KEY);
// Both values must be passed as arguments — the function runs in the browser, where Node-side
// variables are not in scope.
await page.evaluate(([key, sid]) => window.localStorage.setItem(key, sid), [SESSION_KEY, sessionId]);
await page.reload();
await expect(adminBtn).toBeVisible({ timeout: 30_000 });
await adminBtn.click();