import Scroll from '../../../blots/scroll'; describe('Block Embed', function() { it('insert', function() { let scroll = this.initialize(Scroll, '
0123
'); scroll.insertAt(2, 'video', '#'); expect(scroll.domNode).toEqualHTML(`01
23
`); }); it('split newline', function() { let scroll = this.initialize(Scroll, '0123
'); scroll.insertAt(4, 'video', '#'); expect(scroll.domNode).toEqualHTML(`0123
0123
'); scroll.insertAt(5, 'video', '#'); expect(scroll.domNode).toEqualHTML(`0123
`); }); it('insert text before', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(0, 'Test'); expect(scroll.domNode).toEqualHTML(`Test
`); }); it('insert text after', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(1, 'Test'); expect(scroll.domNode).toEqualHTML(`Test
`); }); it('insert inline embed before', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(0, 'image', '/assets/favicon.png'); expect(scroll.domNode).toEqualHTML(` `); }); it('insert inline embed after', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(1, 'image', '/assets/favicon.png'); expect(scroll.domNode).toEqualHTML(` `); }); it('insert block embed before', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(0, 'video', '#1'); expect(scroll.domNode).toEqualHTML(` `); }); it('insert block embed after', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(1, 'video', '#1'); expect(scroll.domNode).toEqualHTML(` `); }); it('insert newline before', function() { let scroll = this.initialize(Scroll, ''); scroll.insertAt(0, '\n'); scroll.optimize(); expect(scroll.domNode).toEqualHTML(`0123
'); scroll.deleteAt(4, 1); expect(scroll.domNode).toEqualHTML(`0123
`); }); });