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 @@ +