Skip to content

Commit

Permalink
tests: properly clear cookies in test helper
Browse files Browse the repository at this point in the history
This was introduced in 2012 with cd368b5.
  • Loading branch information
orblivion committed Mar 27, 2020
1 parent be5b278 commit 4c281f9
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion tests/frontend/helper.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 4c281f9

Please sign in to comment.