From 5666c34061c5ab2ea19c2a9068a84750aa5e3e21 Mon Sep 17 00:00:00 2001 From: Richard Hansen Date: Wed, 31 Mar 2021 04:37:38 -0400 Subject: [PATCH] tests: Fix encoding of prefs cookie --- src/tests/frontend/helper.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/tests/frontend/helper.js b/src/tests/frontend/helper.js index 2ce623f82..742751100 100644 --- a/src/tests/frontend/helper.js +++ b/src/tests/frontend/helper.js @@ -69,8 +69,9 @@ const helper = {}; // I don't fully understand it, but this function seems to properly simulate // padCookie.setPref in the client code helper.setPadPrefCookie = (prefs) => { + const val = encodeURIComponent(JSON.stringify(prefs)); helper.padChrome$.document.cookie = - (`prefsHttp=${escape(JSON.stringify(prefs))};expires=Thu, 01 Jan 3000 00:00:00 GMT`); + `prefsHttp=${val};expires=Thu, 01 Jan 3000 00:00:00 GMT`; }; // Functionality for knowing what key event type is required for tests