mediawiki-extensions-Visual.../tests/ve2/dm/ve.dm.HTMLConverter.test.js
Christian Williams 07b4534a4c Basic test for HTMLConverter
Change-Id: Ie3fa3e036b92052305288c64edca8f404afded72
2012-05-10 16:28:45 -07:00

22 lines
516 B
JavaScript

module( 've.dm.HTMLConverter' );
// Tests
test( 'convertHTML', 1, function() {
var HTML = $('<div><p>abc</p></div>');
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 );
} );