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 ) {
|
2021-11-03 12:28:17 +00:00
|
|
|
var cases = ve.dm.citeExample.domToDataCases;
|
2016-02-05 20:54:55 +00:00
|
|
|
|
2021-11-03 12:28:17 +00:00
|
|
|
for ( var msg in cases ) {
|
|
|
|
var caseItem = ve.copy( cases[ msg ] );
|
2016-02-05 20:54:55 +00:00
|
|
|
if ( caseItem.mwConfig ) {
|
|
|
|
mw.config.set( caseItem.mwConfig );
|
|
|
|
}
|
|
|
|
|
|
|
|
ve.test.utils.runGetModelFromDomTest( assert, caseItem, msg );
|
|
|
|
}
|
|
|
|
} );
|
|
|
|
|
|
|
|
QUnit.test( 'getDomFromModel', function ( assert ) {
|
2021-11-03 12:28:17 +00:00
|
|
|
var cases = ve.dm.citeExample.domToDataCases;
|
2016-02-05 20:54:55 +00:00
|
|
|
|
2021-11-03 12:28:17 +00:00
|
|
|
for ( var msg in cases ) {
|
|
|
|
var caseItem = ve.copy( cases[ msg ] );
|
2016-02-05 20:54:55 +00:00
|
|
|
if ( caseItem.mwConfig ) {
|
|
|
|
mw.config.set( caseItem.mwConfig );
|
|
|
|
}
|
|
|
|
|
|
|
|
ve.test.utils.runGetDomFromModelTest( assert, caseItem, msg );
|
|
|
|
}
|
|
|
|
} );
|