You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
'test selection after auto embedding - empty editor': function(){
382
+
varbot=this.editorBot,
383
+
editor=bot.editor,
384
+
pastedText='https://foo.bar/g/200/382';
385
+
386
+
bot.setData('',function(){
387
+
editor.focus();
388
+
editor.execCommand('paste',pastedText);
389
+
390
+
wait(function(){
391
+
// Check if there is exactly one additional <p> created after the widget.
392
+
assert.areSame('<div data-oembed-url="'+pastedText+'"><img src="'+pastedText+'" /></div><p>\u00A0</p>',editor.getData(),'right editor data after paste');
393
+
varp=editor.editable().findOne('p');
394
+
395
+
// Check if caret is inside newly created <p>.
396
+
varrange=editor.getSelection().getRanges()[0];
397
+
assert.isTrue(range.collapsed,'selection after paste is collapsed');
398
+
assert.areSame(0,range.startOffset,'selection at the beginning of the paragraph');
399
+
assert.isTrue(range.startContainer.equals(p),'selection inside correct p element');
400
+
},200);
401
+
});
402
+
},
403
+
404
+
// #13429.
405
+
'test selection after auto embedding - inside content': function(){
Copy file name to clipboardExpand all lines: tests/plugins/autoembed/manual/autoembed.md
+3-1Lines changed: 3 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -11,4 +11,6 @@ Things to check:
11
11
* Other content changes.
12
12
* Pasting more complex content (only single links should be embedded).
13
13
* Undo/redo. Note: There should be two steps – one reverting autoembed and one reverting link paste.
14
-
* That in the 1st editor `embed` is used and in the 2nd editor `embedsemantic` (check the data).
14
+
* After pasting a link write some text **before** the content is embedded. Alternatively, simply change the selection. Check if the selection is **exactly the same** as before the insertion.
15
+
* Check if all operations are saved in undo steps (paste link, write text, insert content, write text.)
16
+
* That in the 1st editor `embed` is used and in the 2nd editor `embedsemantic` (check the data).
0 commit comments