diff --git a/src/tests/frontend/helper/multipleUsers.js b/src/tests/frontend/helper/multipleUsers.js index b4dfc9188..831bf403e 100644 --- a/src/tests/frontend/helper/multipleUsers.js +++ b/src/tests/frontend/helper/multipleUsers.js @@ -1,5 +1,21 @@ 'use strict'; +const getCookies = + () => helper.padChrome$.window.require('ep_etherpad-lite/static/js/pad_utils').Cookies; + +const setToken = (token) => getCookies().set('token', token); + +const getToken = () => getCookies().get('token'); + +const startActingLike = (user) => { + helper.padChrome$ = user.padChrome$; + helper.padOuter$ = user.padOuter$; + helper.padInner$ = user.padInner$; + if (helper.padChrome$) setToken(user.token); +}; + +const clearToken = () => getCookies().remove('token'); + helper.multipleUsers = { _user0: null, _user1: null, @@ -47,14 +63,11 @@ helper.multipleUsers = { }, async _createUser1Frame() { - // create the iframe - const padUrl = this._user0.$frame.attr('src'); - this._user1.$frame = $('