From 189e3eddbec18c3fe82e18f9f0f5923f5281234a Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Wed, 16 May 2012 13:41:26 -0700 Subject: [PATCH] Another test for HTMLConverter Change-Id: I9b0fa2de44381b363fb6e612884f9911996e941b --- tests/ve2/dm/ve.dm.HTMLConverter.test.js | 29 +++++++----------------- 1 file changed, 8 insertions(+), 21 deletions(-) diff --git a/tests/ve2/dm/ve.dm.HTMLConverter.test.js b/tests/ve2/dm/ve.dm.HTMLConverter.test.js index 3e70ac7b1d..aa4ae39c97 100644 --- a/tests/ve2/dm/ve.dm.HTMLConverter.test.js +++ b/tests/ve2/dm/ve.dm.HTMLConverter.test.js @@ -26,6 +26,14 @@ test( 'convertHTML', function() { { 'type': '/paragraph' } ], 'message': 'bold, italic, underline' + }, + { + 'html': '', + '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 = $('

abc

'); - 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 = $('

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' } ]; - convertedLinearModel = ve.dm.HTMLConverter.getLinearModel(HTML[0]); - strictEqual( convertedLinearModel.data, linearModel.data, 'bold, italic, underline' ); -*/ } );