import { describe, expect, it } from 'vitest';
import normaliseBlocks from '../normalise-blocks';
describe( 'normaliseBlocks', () => {
it( 'should convert double line breaks to paragraphs', () => {
expect( normaliseBlocks( 'test
test' ) ).toEqual(
'
test
test
' ); } ); it( 'should not convert single line break to paragraphs', () => { expect( normaliseBlocks( 'testtest
test
test
test
' ); expect( normaliseBlocks( 'test
test
' ); } ); it( 'should preserve non-inline content', () => { const HTML = 'test
' ) ).toEqual( '' ); } ); it( 'should wrap lose inline elements', () => { expect( normaliseBlocks( 'test' ) ).toEqual( '' ); } ); it( 'should not break between inline siblings', () => { expect( normaliseBlocks( 'test is a test of test using a test.' ) ).toEqual( '
test is a test of test using a test.
' ); } ); it( 'should not append empty text nodes', () => { expect( normaliseBlocks( 'test
\n' ) ).toEqual( 'test
' ); } ); } );