tests: Speed up helper.edit() and helper.clearPad()

This commit is contained in:
Richard Hansen 2021-04-01 15:52:39 -04:00 committed by webzwo0i
parent 7a154b1e1d
commit 7cbb3f565d
3 changed files with 33 additions and 6 deletions

View file

@ -44,6 +44,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
let channelState = 'CONNECTING';
let lastCommitTime = 0;
let initialStartConnectTime = 0;
let commitDelay = 500;
const userId = initialUserInfo.userId;
// var socket;
@ -102,7 +103,7 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
return;
}
const earliestCommit = lastCommitTime + 500;
const earliestCommit = lastCommitTime + commitDelay;
if (now < earliestCommit) {
setTimeout(handleUserChanges, earliestCommit - now);
return;
@ -488,6 +489,8 @@ const getCollabClient = (ace2editor, serverVars, initialUserInfo, options, _pad)
setChannelState,
setStateIdle,
setIsPendingRevision,
set commitDelay(ms) { commitDelay = ms; },
get commitDelay() { return commitDelay; },
};
tellAceAboutHistoricalAuthors(serverVars.historicalAuthorData);