module( 've.dm.HTMLConverter' ); // Tests test( 'convertHTML', function() { var cases = [ { 'html': '

abc

', 'linearModel': [ { 'type': 'paragraph' }, 'a', 'b', 'c', { 'type': '/paragraph' } ], 'message': 'paragraph and text' }, { 'html': '

abc

', 'linearModel': [ { 'type': 'paragraph' }, ['a', { '{"type":"textStyle/bold"}': { 'type': 'textStyle/bold' } }], ['b', { '{"type":"textStyle/italic"}': { 'type': 'textStyle/italic' } }], ['c', { '{"type":"textStyle/underline"}': { 'type': 'textStyle/underline' } }], { 'type': '/paragraph' } ], 'message': 'bold, italic, underline' }, { 'html': '', 'linearModel': [ { 'type': 'image', 'attributes' : { 'html/src' : 'image.png' } }, { 'type' : '/image' } ], 'message': 'image' } ]; expect(cases.length); for ( var i = 0; i < cases.length; i++ ) { var convertedLinearModel = ve.dm.HTMLConverter.getLinearModel( $('
' + cases[i].html + '
')[0] ); //console.log( convertedLinearModel ); //console.log( cases[i].linearModel ); deepEqual( convertedLinearModel, cases[i].linearModel, cases[i].message); } } );