fix empty type name

This commit is contained in:
Kevin Jahns
2020-07-12 18:39:15 +02:00
5 changed files with 24 additions and 31 deletions

View File

@@ -17,3 +17,16 @@ export const testClientIdDuplicateChange = tc => {
Y.applyUpdate(doc2, Y.encodeStateAsUpdate(doc1))
t.assert(doc2.clientID !== doc1.clientID)
}
/**
* @param {t.TestCase} tc
*/
export const testGetTypeEmptyId = tc => {
const doc1 = new Y.Doc()
doc1.getText('').insert(0, 'h')
doc1.getText().insert(1, 'i')
const doc2 = new Y.Doc()
Y.applyUpdate(doc2, Y.encodeStateAsUpdate(doc1))
t.assert(doc2.getText().toString() === 'hi')
t.assert(doc2.getText('').toString() === 'hi')
}

View File

@@ -6,7 +6,7 @@ import * as xml from './y-xml.tests.js'
import * as encoding from './encoding.tests.js'
import * as undoredo from './undo-redo.tests.js'
import * as compatibility from './compatibility.tests.js'
import * as consistency from './consistency.tests.js'
import * as doc from './doc.tests.js'
import { runTests } from 'lib0/testing.js'
import { isBrowser, isNode } from 'lib0/environment.js'
@@ -16,7 +16,7 @@ if (isBrowser) {
log.createVConsole(document.body)
}
runTests({
map, array, text, xml, consistency, encoding, undoredo, compatibility
map, array, text, xml, doc, encoding, undoredo, compatibility
}).then(success => {
/* istanbul ignore next */
if (isNode) {