Skip to content

Commit

Permalink
add test unit for formatBlock
Browse files Browse the repository at this point in the history
  • Loading branch information
easylogic committed Sep 14, 2017
1 parent 8b31140 commit fecab64
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions test/unit/base/module/Editor.spec.js
Expand Up @@ -213,6 +213,25 @@ define([
});
});

describe('formatBlock', function () {
it('should apply formatBlock', function () {
context.layoutInfo.editable.appendTo('body');
editor.formatBlock('blockquote');

// start <p>hello</p> => <blockquote>hello</blockquote>
expectContents(context, '<blockquote>hello</blockquote>');
});

it('should apply custom className in formatBlock', function () {
context.layoutInfo.editable.appendTo('body');
var $target = $('<blockquote class="blockquote" />');
editor.formatBlock('blockquote', $target);

// start <p>hello</p> => <blockquote class="blockquote">hello</blockquote>
expectContents(context, '<blockquote class="blockquote">hello</blockquote>');
});
});

describe('createLink', function () {
it('should create normal link', function () {
var text = 'hello';
Expand Down

0 comments on commit fecab64

Please sign in to comment.