From 770c1c80b7a57360e22579dbc0d00be7a385b533 Mon Sep 17 00:00:00 2001 From: Daniel Krol Date: Tue, 24 Mar 2020 13:38:45 -0400 Subject: [PATCH] tests: properly clear cookies in test helper This was introduced in 2012 with cd368b5f8eed. --- tests/frontend/helper.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tests/frontend/helper.js b/tests/frontend/helper.js index 800dfb293..449355e5d 100644 --- a/tests/frontend/helper.js +++ b/tests/frontend/helper.js @@ -53,7 +53,10 @@ var helper = {}; } helper.clearCookies = function(){ - window.document.cookie = ""; + // Expire cookies, so author and language are changed after reloading the pad. + // See https://developer.mozilla.org/en-US/docs/Web/API/Document/cookie#Example_4_Reset_the_previous_cookie + window.document.cookie = 'token=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; + window.document.cookie = 'language=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/'; } // Functionality for knowing what key event type is required for tests