mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-21 10:33:05 +00:00
bc0e96f78a
This calls "parent" methods automatically, and allow us to pass a config parameter for MW config. Change-Id: I571d4599d7fca55727070bcac6083d1232b1f61c
35 lines
901 B
JavaScript
35 lines
901 B
JavaScript
/*!
|
|
* VisualEditor DataModel MediaWiki-specific Converter tests.
|
|
*
|
|
* @copyright 2011-2020 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
QUnit.module( 've.dm.Converter (MW)', ve.test.utils.newMwEnvironment() );
|
|
|
|
QUnit.test( 'getModelFromDom', ( assert ) => {
|
|
const cases = ve.dm.mwExample.domToDataCases;
|
|
|
|
for ( const msg in cases ) {
|
|
const caseItem = ve.copy( cases[ msg ] );
|
|
if ( caseItem.mwConfig ) {
|
|
mw.config.set( caseItem.mwConfig );
|
|
}
|
|
|
|
ve.test.utils.runGetModelFromDomTest( assert, caseItem, msg );
|
|
}
|
|
} );
|
|
|
|
QUnit.test( 'getDomFromModel', ( assert ) => {
|
|
const cases = ve.dm.mwExample.domToDataCases;
|
|
|
|
for ( const msg in cases ) {
|
|
const caseItem = ve.copy( cases[ msg ] );
|
|
if ( caseItem.mwConfig ) {
|
|
mw.config.set( caseItem.mwConfig );
|
|
}
|
|
|
|
ve.test.utils.runGetDomFromModelTest( assert, caseItem, msg );
|
|
}
|
|
} );
|