Skip to content

Commit

Permalink
Added tests with enabled div plugin.
Browse files Browse the repository at this point in the history
  • Loading branch information
jacekbogdanski committed Dec 19, 2018
1 parent d988b0e commit 764ad73
Show file tree
Hide file tree
Showing 4 changed files with 82 additions and 3 deletions.
51 changes: 49 additions & 2 deletions tests/plugins/enterkey/list.js
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@
config: {
enterMode: CKEDITOR.ENTER_BR
}
},
enterDIV: {
name: 'enterDIV',
config: {
enterMode: CKEDITOR.ENTER_P,
extraPlugins: 'div'
}
}
};

Expand Down Expand Up @@ -630,7 +637,7 @@
},

// (#2205)
'test enterkey: block placeholder at the end': function() {
'test enterkey: block p placeholder at the end': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
Expand All @@ -650,7 +657,7 @@
},

// (#2205)
'test enterkey: block placeholder at the beginning': function() {
'test enterkey: block p placeholder at the beginning': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
Expand All @@ -666,6 +673,46 @@
'<li>^&nbsp;</li>' +
'</ul>',

true, 'New item should be added to the list.', true );
},

// (#2205)
'test enterkey: block div placeholder at the beginning': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
'<div>^</div>' +
'foo' +
'</li>' +
'</ul>',

'<ul>' +
'<li>' +
'foo' +
'</li>' +
'<li>^&nbsp;</li>' +
'</ul>',

true, 'New item should be added to the list.', true );
},

// (#2205)
'test enterkey: block div placeholder at the end': function() {
assertEnter( 'enterP',
'<ul>' +
'<li>' +
'foo' +
'<div>^</div>' +
'</li>' +
'</ul>',

'<ul>' +
'<li>' +
'foo' +
'</li>' +
'<li>^&nbsp;</li>' +
'</ul>',

true, 'New item should be added to the list.', true );
}
} );
Expand Down
2 changes: 1 addition & 1 deletion tests/plugins/enterkey/manual/blockplaceholder.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
@bender-tags: 4.11.2, bug, 2205
@bender-tags: 4.11.0, bug, 2205
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, enterkey, list

Expand Down
12 changes: 12 additions & 0 deletions tests/plugins/enterkey/manual/divplaceholder.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
<div id="editor">
<ul>
<li>
foo
<div><br></div>
</li>
</ul>
</div>

<script>
CKEDITOR.replace( 'editor' );
</script>
20 changes: 20 additions & 0 deletions tests/plugins/enterkey/manual/divplaceholder.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
@bender-tags: 4.11.0, bug, 2205
@bender-ui: collapsed
@bender-ckeditor-plugins: wysiwygarea, toolbar, enterkey, list, div

1. Place a cursor right under list item.

```
* foo
^ - put selection here
```

2. Press `Enter`.

## Expected

Empty line has been replaced by the new empty list item.

## Unexpected

List has been removed from the editor.

0 comments on commit 764ad73

Please sign in to comment.