Skip to content

Commit

Permalink
fixed range test
Browse files Browse the repository at this point in the history
  • Loading branch information
easylogic committed Dec 14, 2019
1 parent caf6813 commit a05c1c0
Showing 1 changed file with 3 additions and 10 deletions.
13 changes: 3 additions & 10 deletions test/base/module/Editor.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ describe('Editor', () => {
document.body.click();
editor.setLastRange();

expect(editor.lastRange.sc).to.equal(editor.editable);
expect(editor.lastRange.sc).to.equal(editor.editable.lastChild);
});
});

Expand Down Expand Up @@ -253,15 +253,7 @@ describe('Editor', () => {
});

describe('insertHorizontalRule', () => {
it('should insert horizontal rule without splitting tag', () => {
editor.insertHorizontalRule();
expectContents(context, '<p>hello</p><hr>');
});

it('should insert horizontal rule with splitting tag', () => {
var textNode = $editable.find('p')[0].firstChild;
var rng = range.create(textNode, 5, textNode, 5).normalize().select();
editor.lastRange = rng;
it('should insert horizontal rule', () => {
editor.insertHorizontalRule();
expectContents(context, '<p>hello</p><hr><p><br></p>');
});
Expand All @@ -275,6 +267,7 @@ describe('Editor', () => {
'<tr><td><br></td><td><br></td></tr>',
'<tr><td><br></td><td><br></td></tr>',
'</tbody></table>',
'<p><br></p>'
].join('');
editor.insertTable('2x2');
expectContents(context, markup);
Expand Down

0 comments on commit a05c1c0

Please sign in to comment.