X-Git-Url: https://git.mdrn.pl/fnpeditor.git/blobdiff_plain/5766035cdc88ebe92caab7af494e5e077235d5e0..612d7ff15c5ba8f014755af33b766f9db76f7df5:/src/editor/plugins/core/core.test.js diff --git a/src/editor/plugins/core/core.test.js b/src/editor/plugins/core/core.test.js index f227b67..a33ae61 100644 --- a/src/editor/plugins/core/core.test.js +++ b/src/editor/plugins/core/core.test.js @@ -621,6 +621,17 @@ describe('Keyboard interactions', function() { expect(selection.offset).to.equal(0); }); + it('does nothing on an empty paragraph', function() { + var c = getCanvasFromXML('
a
'), + k = new Keyboard(c), + spy = sinon.spy(); + + k.withCaret('a|').press(K.BACKSPACE); + c.wlxmlDocument.on('change', spy); + k.press(K.ENTER); + expect(spy.callCount).to.equal(0); + }); + it('splits its parent box if inside a span', function() { var c = getCanvasFromXML('
this is a paragraph
'), k = new Keyboard(c);