From d92101274e7c1bdfc560e7d023b15ec9cbd7e643 Mon Sep 17 00:00:00 2001 From: Aarni Halinen Date: Tue, 24 Nov 2020 23:12:39 +0200 Subject: [PATCH] Set Cookie on e2e test --- tests/testcafe/admin.test.ts | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/tests/testcafe/admin.test.ts b/tests/testcafe/admin.test.ts index 6874b84..bad0096 100644 --- a/tests/testcafe/admin.test.ts +++ b/tests/testcafe/admin.test.ts @@ -47,11 +47,10 @@ test("User is redirected to login when JWT token is invalid", async t => { /** * Test if the user is redirected to login when JWT token is invalid. */ - const TOKEN = "FOOBAR"; const setCookie = ClientFunction(() => { - document.cookie = `jwt=${TOKEN}`; + document.cookie = "jwt=FOOBAR"; }); - + await setCookie(); await t.navigateTo("/admin/events"); const loginForm = Selector("form.admin-login-form");