mediawiki-extensions-Cite/modules/ve-cite/tests/ve.dm.Converter.test.js
Ed Sanders 0ef557a509 VE tests: Suppress XML warnings
The XML validator can't handle unescaped < in attributes
so always throws a warning.

Change-Id: Ie49e4080c049dea6eea714abdeb37f6764baaa2a
2022-01-10 14:21:44 +00:00

39 lines
1.1 KiB
JavaScript

/*!
* VisualEditor DataModel Cite-specific Converter tests.
*
* @copyright 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
* @license MIT
*/
QUnit.module( 've.dm.Converter (Cite)', ve.test.utils.mwEnvironment );
QUnit.test( 'getModelFromDom', function ( assert ) {
var cases = ve.dm.citeExample.domToDataCases;
for ( var msg in cases ) {
var caseItem = ve.copy( cases[ msg ] );
// TODO: Cite tests contain unsecaped < in attrs, handle this upstream somehow
caseItem.ignoreXmlWarnings = true;
if ( caseItem.mwConfig ) {
mw.config.set( caseItem.mwConfig );
}
ve.test.utils.runGetModelFromDomTest( assert, caseItem, msg );
}
} );
QUnit.test( 'getDomFromModel', function ( assert ) {
var cases = ve.dm.citeExample.domToDataCases;
for ( var msg in cases ) {
var caseItem = ve.copy( cases[ msg ] );
// TODO: Cite tests contain unsecaped < in attrs, handle this upstream somehow
caseItem.ignoreXmlWarnings = true;
if ( caseItem.mwConfig ) {
mw.config.set( caseItem.mwConfig );
}
ve.test.utils.runGetDomFromModelTest( assert, caseItem, msg );
}
} );