import Scroll from '../../../blots/scroll'; describe('Inline', function() { it('format order', function() { const scroll = this.initialize(Scroll, '

Hello World!

'); scroll.formatAt(0, 1, 'bold', true); scroll.formatAt(0, 1, 'italic', true); scroll.formatAt(2, 1, 'italic', true); scroll.formatAt(2, 1, 'bold', true); expect(scroll.domNode).toEqualHTML( '

Hello World!

', ); }); it('reorder', function() { const scroll = this.initialize(Scroll, '

0123

'); const p = scroll.domNode.firstChild; const em = document.createElement('em'); Array.from(p.childNodes).forEach(function(node) { em.appendChild(node); }); p.appendChild(em); expect(scroll.domNode).toEqualHTML('

0123

'); scroll.update(); expect(scroll.domNode).toEqualHTML( '

0123

', ); }); });