UNPKG

@ryusei/code

Version:

<div align="center"> <a href="https://code.ryuseijs.com"> <img alt="RyuseiCode" src="https://code.ryuseijs.com/images/svg/logo.svg" width="70"> </a>

25 lines (18 loc) 651 B
import { init } from '../../../../test'; describe( 'Lines#delete()', () => { const Editor = init(); const { lines } = Editor.Components.Code; test( 'can delete a line at the specified row.', () => { lines.sync( 0, `1\n2\n3` ); lines.delete( 1, 1 ); expect( lines[ 0 ].text ).toBe( '1' ); expect( lines[ 1 ].text ).toBe( '3' ); } ); test( 'can delete lines from the specified row.', () => { lines.sync( 0, `1\n2\n3\n4\n5` ); lines.delete( 2, 2 ); expect( lines[ 0 ].text ).toBe( '1' ); expect( lines[ 1 ].text ).toBe( '2' ); expect( lines[ 2 ].text ).toBe( '5' ); } ); } );