2016-02-05 20:54:55 +00:00
|
|
|
/*!
|
|
|
|
* VisualEditor DataModel Cite-specific Converter tests.
|
|
|
|
*
|
2018-01-03 01:05:45 +00:00
|
|
|
* @copyright 2011-2018 VisualEditor Team's Cite sub-team and others; see AUTHORS.txt
|
2017-12-29 12:12:35 +00:00
|
|
|
* @license MIT
|
2016-02-05 20:54:55 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
QUnit.module( 've.dm.Converter (Cite)', ve.test.utils.mwEnvironment );
|
|
|
|
|
|
|
|
QUnit.test( 'getModelFromDom', function ( assert ) {
|
|
|
|
var msg, caseItem,
|
|
|
|
cases = ve.dm.citeExample.domToDataCases;
|
|
|
|
|
|
|
|
for ( msg in cases ) {
|
|
|
|
caseItem = ve.copy( cases[ msg ] );
|
|
|
|
if ( caseItem.mwConfig ) {
|
|
|
|
mw.config.set( caseItem.mwConfig );
|
|
|
|
}
|
|
|
|
|
|
|
|
ve.test.utils.runGetModelFromDomTest( assert, caseItem, msg );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
QUnit.test( 'getDomFromModel', function ( assert ) {
|
|
|
|
var msg, caseItem,
|
|
|
|
cases = ve.dm.citeExample.domToDataCases;
|
|
|
|
|
|
|
|
for ( msg in cases ) {
|
|
|
|
caseItem = ve.copy( cases[ msg ] );
|
|
|
|
if ( caseItem.mwConfig ) {
|
|
|
|
mw.config.set( caseItem.mwConfig );
|
|
|
|
}
|
|
|
|
|
|
|
|
ve.test.utils.runGetDomFromModelTest( assert, caseItem, msg );
|
|
|
|
}
|
|
|
|
} );
|