mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Cite
synced 2024-12-21 02:52:42 +00:00
0eb0893c96
Depends-On: Ib20c1f5277c5d5a99f5117c82b7cbdeab75d3279 Change-Id: Id5ff5d126f3946621ed36c5f79b5f58624931d16
39 lines
1.1 KiB
JavaScript
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.newMwEnvironment() );
|
|
|
|
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 );
|
|
}
|
|
} );
|