Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitb555c0d

Browse files
committed
add tests foryjs/yjs#291
1 parent5ca3f01 commitb555c0d

File tree

1 file changed

+18
-0
lines changed

1 file changed

+18
-0
lines changed

‎test/y-quill.test.js

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,24 @@ export const testBasicInsert = () => {
3636
t.assert(editor.getText()==='texttext\n')
3737
}
3838

39+
/**
40+
*@param {t.TestCase} tc
41+
*/
42+
exportconsttestConcurrentOverlappingFormatting=tc=>{
43+
const{ editor, type}=createQuillEditor()
44+
const{editor:editor2,type:type2}=createQuillEditor()
45+
type.insert(0,'abcdef')
46+
Y.applyUpdate(type2.doc,Y.encodeStateAsUpdate(type.doc))
47+
editor.updateContents([{retain:3,attributes:{bold:true}}])
48+
editor2.updateContents([{retain:2},{retain:2,attributes:{bold:true}}])
49+
// sync
50+
Y.applyUpdate(type.doc,Y.encodeStateAsUpdate(type2.doc))
51+
Y.applyUpdate(type2.doc,Y.encodeStateAsUpdate(type.doc))
52+
console.log(editor.getContents().ops)
53+
console.log(editor2.getContents().ops)
54+
t.compare(editor.getContents().ops,editor2.getContents().ops)
55+
}
56+
3957
letcharCounter=0
4058

4159
constmarksChoices=[

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp