tests: properly clear cookies in test helper

This was introduced in 2012 with cd368b5f8e.
pull/3899/head^2
Daniel Krol 2020-03-24 13:38:45 -04:00 committed by muxator
parent 30884dd93d
commit 770c1c80b7
1 changed files with 4 additions and 1 deletions

View File

@ -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