From e24a5788c06211d9d098921c7d388719b626b1db Mon Sep 17 00:00:00 2001 From: Kamil Krzywda Date: Thu, 24 Sep 2026 09:56:05 +0000 Subject: [PATCH] =?UTF-8?q?v0.71.0:=20fix=20admin=20e2e=20=E2=80=94=20pass?= =?UTF-8?q?=20sessionId=20into=20page.evaluate?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- e2e/admin.spec.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/e2e/admin.spec.ts b/e2e/admin.spec.ts index afe3c76..aff0f44 100644 --- a/e2e/admin.spec.ts +++ b/e2e/admin.spec.ts @@ -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();