Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
9 changed files
with
113 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
/* bender-tags: editor,unit,autoparagraphing */ | ||
|
||
( function () { | ||
'use strict'; | ||
|
||
var doc = CKEDITOR.document; | ||
|
||
bender.test( { | ||
// Initialize the editor instance. | ||
'async:init': function() { | ||
var that = this; | ||
|
||
bender.tools.setUpEditors( { | ||
editor1: { | ||
name: 'editor1' | ||
} | ||
}, function( editors, bots ) { | ||
that.editors = editors; | ||
that.callback(); | ||
} ); | ||
}, | ||
|
||
// (#12162) | ||
'test autoparagraphing in nested editable': function() { | ||
var editor = this.editors.editor1, | ||
editable = editor.editable(), | ||
expected = | ||
'<p>foo@</p>' + | ||
'<div contenteditable="false">' + | ||
'<div contenteditable="true">' + | ||
'<p>^hello@</p>' + | ||
'</div>' + | ||
'</div>', | ||
htmlMatchingOpts = { | ||
compareSelection: true, | ||
normalizeSelection: true | ||
}; | ||
|
||
bender.tools.selection.setWithHtml( editor, | ||
'<p>f[o]o</p>' + | ||
'<div contenteditable="false">' + | ||
'<div contenteditable="true">' + | ||
'hello' + | ||
'</div>' + | ||
'</div>' ); | ||
|
||
var nestedEditable = editable.findOne( 'div[contenteditable="true"]' ), | ||
sel = editor.getSelection(), | ||
range = editor.createRange(); | ||
|
||
nestedEditable.focus(); | ||
range.setStart( nestedEditable, 0 ); | ||
range.setEnd( nestedEditable, 0 ); | ||
sel.selectRanges( [ range ] ); | ||
|
||
assert.isInnerHtmlMatching( expected, bender.tools.selection.getWithHtml( editor ), | ||
htmlMatchingOpts, 'Paragraph should be added.' ); | ||
} | ||
} ); | ||
} )(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
/* bender-tags: editor,unit */ | ||
/* bender-tags: editor,unit,autoparagraphing */ | ||
|
||
'use strict'; | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters