Another test for HTMLConverter

Change-Id: I9b0fa2de44381b363fb6e612884f9911996e941b
This commit is contained in:
Christian Williams 2012-05-16 13:41:26 -07:00
parent 5d06b26a6e
commit 189e3eddbe

View file

@ -26,6 +26,14 @@ test( 'convertHTML', function() {
{ 'type': '/paragraph' }
],
'message': 'bold, italic, underline'
},
{
'html': '<img src="http://www.something.com/test.jpg">',
'linearModel': [
{ 'type': 'image', 'attributes' : { 'html/src' : 'http://www.something.com/test.jpg' } },
{ 'type' : '/image' }
],
'message': 'image'
}
];
expect(cases.length);
@ -40,25 +48,4 @@ test( 'convertHTML', function() {
deepEqual(convertedLinearModel, c.linearModel, c.message);
}
/*
//paragraph and text
HTML = $('<div><p>abc</p></div>');
linearModel = [ { 'type': 'paragraph' }, 'a', 'b', 'c', { 'type': '/paragraph' } ];
convertedLinearModel = ve.dm.HTMLConverter.getLinearModel(HTML[0]);
strictEqual( convertedLinearModel.data, linearModel.data, 'paragraph and text' );
//paragraph and text
HTML = $('<div><p><b>a</b><i>b</i><u>c</u></p></div>');
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' } ];
convertedLinearModel = ve.dm.HTMLConverter.getLinearModel(HTML[0]);
strictEqual( convertedLinearModel.data, linearModel.data, 'bold, italic, underline' );
*/
} );