Skip to content

Commit

Permalink
Adding unit and manual tests.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mateusz Samsel committed Sep 7, 2017
1 parent 141fd23 commit 5308b70
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 0 deletions.
32 changes: 32 additions & 0 deletions tests/plugins/indentlist/indentlist.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
/* bender-tags: editor */
/* bender-ckeditor-plugins: toolbar,indentlist,list,wysiwygarea */
/* bender-ui: collapsed */

( function() {
'use strict';

bender.editor = true;

bender.test( {
'test indention keeps proper list tags': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '<ul><li>foo</li><li>bar<ol><li>111</li></ol><li>[222</li><li>333]</li></li><li>baz</li></ul>' );
bot.execCommand( 'indent' );

assert.beautified.html( '<ul><li>foo</li><li>bar<ol><li>111</li><li>222</li><li>333</li></ol></li><li>baz</li></ul>', bot.getData() );
},

'test outdent and indent get proper list tags': function() {
var bot = this.editorBot;

bot.setHtmlWithSelection( '<ol><li>foo</li><li>bar<ul><li>111</li><li>2^22</li><li>333</li></ul></li><li>baz</li></ol>' );

bot.execCommand( 'outdent' );
assert.beautified.html( '<ol><li>foo</li><li>bar<ul><li>111</li></ul></li><li>222<ul><li>333</li></ul></li><li>baz</li></ol>', bot.getData() );

bot.execCommand( 'indent' );
assert.beautified.html( '<ol><li>foo</li><li>bar<ul><li>111</li><li>222<ul><li>333</li></ul></li></ul></li><li>baz</li></ol>', bot.getData() );
}
} );
} )();
7 changes: 7 additions & 0 deletions tests/plugins/indentlist/manual/keepcorrectlisttag.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<textarea name="" id="editor" cols="30" rows="10">
<ol><li>one</li><li>two<ul><li>111</li><li>222</li><li>333</li></ul></li><li>three</li></ol>
</textarea>

<script>
CKEDITOR.replace( 'editor' );
</script>
14 changes: 14 additions & 0 deletions tests/plugins/indentlist/manual/keepcorrectlisttag.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
@bender-tags: 4.7.3, 842, bug
@bender-ui: collapsed
@bender-ckeditor-plugins: toolbar, wysiwygarea, list, indentlist

----

1. Put caret in paragraph with `333`.
1. Use `Decrease indent` to move paragraph to the left.
1. Use `Increase indent` to move paragraph to the right.

**Expected:** List item with `333` has circle as a list tag.

**Unexpected:** List item with `333` has number as a list tag.

0 comments on commit 5308b70

Please sign in to comment.