import Delta from 'quill-delta'; import Editor from '../../../core/editor'; describe('Header', function() { it('add', function() { const editor = this.initialize(Editor, '

0123

'); editor.formatText(4, 1, { header: 1 }); expect(editor.getDelta()).toEqual( new Delta().insert('0123', { italic: true }).insert('\n', { header: 1 }), ); expect(editor.scroll.domNode).toEqualHTML('

0123

'); }); it('remove', function() { const editor = this.initialize(Editor, '

0123

'); editor.formatText(4, 1, { header: false }); expect(editor.getDelta()).toEqual( new Delta().insert('0123', { italic: true }).insert('\n'), ); expect(editor.scroll.domNode).toEqualHTML('

0123

'); }); it('change', function() { const editor = this.initialize(Editor, '

0123

'); editor.formatText(4, 1, { header: 2 }); expect(editor.getDelta()).toEqual( new Delta().insert('0123', { italic: true }).insert('\n', { header: 2 }), ); expect(editor.scroll.domNode).toEqualHTML('

0123

'); }); });