mediawiki-extensions-Visual.../tests/ve2/dm/ve.dm.Converter.test.js
Trevor Parscal 5d20f45120 Added getHtmlElementFromDataElement and getDataElementFromHtmlElement
Change-Id: Ie5f4fd86612b5a6c34b5843d1e9a521edc626a63
2012-06-06 10:17:51 -07:00

28 lines
697 B
JavaScript

module( 've.dm.Converter' );
/* Tests */
test( 'getDataElementFromHtmlElement', function() {
for ( var msg in ve.dm.example.conversions ) {
var conversion = ve.dm.example.conversions[msg];
deepEqual(
ve.dm.converter.getDataElementFromHtmlElement( conversion.htmlElement ),
conversion.dataElement,
msg
);
}
} );
test( 'getHtmlElementFromDataElement', function() {
for ( var msg in ve.dm.example.conversions ) {
var conversion = ve.dm.example.conversions[msg];
deepEqual(
ve.example.getHtmlElementSummary(
ve.dm.converter.getHtmlElementFromDataElement( conversion.dataElement )
),
ve.example.getHtmlElementSummary( conversion.htmlElement ),
msg
);
}
} );