Example #1
0
        it('does nothing if text node is not first child of its parent', function() {
            var doc = getDocumentFromXML('<section><div></div><div><a></a>some text</div></section>'),
                text = getTextNode('some text', doc),
                spy = sinon.spy();

            doc.on('change', spy);
            text.mergeContentUp();
            expect(spy.callCount).to.equal(0);
        });
Example #2
0
        it('does nothing if text node parent is precedeed by text node', function() {
            var doc = getDocumentFromXML('<section><div></div>another text<div>some text</div></section>'),
                text = getTextNode('some text', doc),
                spy = sinon.spy();

            doc.on('change', spy);
            text.mergeContentUp();
            expect(spy.callCount).to.equal(0);
        });
Example #3
0
        it('does nothing on an empty paragraph', function() {
            var c = getCanvasFromXML('<section><div class="p">a</div></section>'),
                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);
        });