mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-21 16:06:16 -04:00
tests: Always set cookie path to / (to match non-test behavior)
This commit is contained in:
parent
5666c34061
commit
137fa89d2a
3 changed files with 4 additions and 15 deletions
|
@ -59,19 +59,14 @@ const helper = {};
|
|||
|
||||
// Can only happen when the iframe exists, so we're doing it separately from other cookies
|
||||
helper.clearPadPrefCookie = () => {
|
||||
helper.padChrome$.document.cookie = 'prefsHttp=;expires=Thu, 01 Jan 1970 00:00:00 GMT';
|
||||
helper.padChrome$.document.cookie = 'prefsHttp=;expires=Thu, 01 Jan 1970 00:00:00 GMT; path=/';
|
||||
};
|
||||
|
||||
// Overwrite all prefs in pad cookie. Assumes http, not https.
|
||||
//
|
||||
// `helper.padChrome$.document.cookie` (the iframe) and `window.document.cookie`
|
||||
// seem to have independent cookies, UNLESS we put path=/ here (which we don't).
|
||||
// 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=${val};expires=Thu, 01 Jan 3000 00:00:00 GMT`;
|
||||
`prefsHttp=${val};expires=Thu, 01 Jan 3000 00:00:00 GMT; path=/`;
|
||||
};
|
||||
|
||||
// Functionality for knowing what key event type is required for tests
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue