mirror of
https://github.com/cudr/slate-collaborative.git
synced 2024-10-27 20:34:06 +00:00
chore: code commenting
This commit is contained in:
parent
d0a7930484
commit
adc7ac7dbf
@ -1,5 +1,8 @@
|
||||
import AutomergeBackend from '../AutomergeBackend'
|
||||
|
||||
/**
|
||||
* Get the number of active connections for the specified docId
|
||||
*/
|
||||
const getActiveConnections = (backend: AutomergeBackend, docId: string) => {
|
||||
const automergeDocument = backend.documentSetMap[docId]
|
||||
|
||||
|
@ -75,10 +75,14 @@ describe('automerge editor client tests', () => {
|
||||
|
||||
let collabEditors: (Editor & WithSocketIOEditor & AutomergeEditor)[] = []
|
||||
afterEach(done => {
|
||||
// Clear our operation traces after each test
|
||||
operationTraces = []
|
||||
|
||||
// Destroy any created collab editors after each test
|
||||
collabEditors.forEach(editor => editor.destroy())
|
||||
collabEditors = []
|
||||
|
||||
// Ensure that the collab document has been cleaned up on the backend
|
||||
waitForCondition(() => !collabBackend.backend.getDocument(docId)).then(done)
|
||||
})
|
||||
|
||||
@ -276,7 +280,7 @@ describe('automerge editor client tests', () => {
|
||||
|
||||
it('should reconnect with no opCount', async () => {
|
||||
const editor1 = await createCollabEditor({ resetOnReconnect: true })
|
||||
console.log('----\neditor1 disconnect\n-----')
|
||||
|
||||
await waitForCondition(() => {
|
||||
return getActiveConnections(collabBackend.backend, docId) === 1
|
||||
})
|
||||
@ -287,7 +291,6 @@ describe('automerge editor client tests', () => {
|
||||
() => getActiveConnections(collabBackend.backend, docId) === 0
|
||||
)
|
||||
|
||||
console.log('----\neditor1 reconnect\n-----')
|
||||
editor1.connect()
|
||||
|
||||
await waitForCondition(
|
||||
|
Loading…
Reference in New Issue
Block a user