mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-23 08:56:17 -04:00
tests: Spy on socket.io messages as early as possible
This commit is contained in:
parent
e28c9ffc97
commit
c8e0916e1a
2 changed files with 25 additions and 29 deletions
|
@ -99,6 +99,16 @@ const helper = {};
|
|||
hookFns: {},
|
||||
}, opts);
|
||||
|
||||
// Set up socket.io spying as early as possible.
|
||||
/** chat messages received */
|
||||
helper.chatMessages = [];
|
||||
/** changeset commits from the server */
|
||||
helper.commits = [];
|
||||
/** userInfo messages from the server */
|
||||
helper.userInfos = [];
|
||||
if (opts.hookFns._socketCreated == null) opts.hookFns._socketCreated = [];
|
||||
opts.hookFns._socketCreated.unshift(() => helper.spyOnSocketIO());
|
||||
|
||||
// if opts.params is set we manipulate the URL to include URL parameters IE ?foo=Bah.
|
||||
let encodedParams;
|
||||
if (opts.params) {
|
||||
|
@ -171,27 +181,6 @@ const helper = {};
|
|||
helper.padOuter$.fx.off = true;
|
||||
helper.padInner$.fx.off = true;
|
||||
|
||||
/*
|
||||
* chat messages received
|
||||
* @type {Array}
|
||||
*/
|
||||
helper.chatMessages = [];
|
||||
|
||||
/*
|
||||
* changeset commits from the server
|
||||
* @type {Array}
|
||||
*/
|
||||
helper.commits = [];
|
||||
|
||||
/*
|
||||
* userInfo messages from the server
|
||||
* @type {Array}
|
||||
*/
|
||||
helper.userInfos = [];
|
||||
|
||||
// listen for server messages
|
||||
helper.spyOnSocketIO();
|
||||
|
||||
return opts.id;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue