From 07b4534a4c1222658cb235a1ba12c5fc4a301640 Mon Sep 17 00:00:00 2001 From: Christian Williams Date: Thu, 10 May 2012 16:28:45 -0700 Subject: [PATCH] Basic test for HTMLConverter Change-Id: Ie3fa3e036b92052305288c64edca8f404afded72 --- tests/ve2/dm/ve.dm.HTMLConverter.test.js | 21 +++++++++++++++++++++ tests/ve2/index.html | 2 ++ 2 files changed, 23 insertions(+) create mode 100644 tests/ve2/dm/ve.dm.HTMLConverter.test.js diff --git a/tests/ve2/dm/ve.dm.HTMLConverter.test.js b/tests/ve2/dm/ve.dm.HTMLConverter.test.js new file mode 100644 index 0000000000..ff6ff7ed15 --- /dev/null +++ b/tests/ve2/dm/ve.dm.HTMLConverter.test.js @@ -0,0 +1,21 @@ +module( 've.dm.HTMLConverter' ); + + +// Tests + +test( 'convertHTML', 1, function() { + var HTML = $('

abc

'); + var linearModel = [ + { 'type': 'paragraph' }, + 'a', + 'b', + 'c', + { 'type': '/paragraph' }, + ]; + var convertedLinearModel = ve.dm.HTMLConverter.getLinearModel(HTML[0]); + + var documentFromLinearModel = new ve.dm.Document ( linearModel ); + var documentFromConvertedLinearModel = new ve.dm.Document ( convertedLinearModel ); + + strictEqual( convertedLinearModel.data, linearModel.data ); +} ); diff --git a/tests/ve2/index.html b/tests/ve2/index.html index 9f9af31bec..65f8075a14 100644 --- a/tests/ve2/index.html +++ b/tests/ve2/index.html @@ -42,6 +42,7 @@ + @@ -105,6 +106,7 @@ +