mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-22 02:53:04 +00:00
346216c050
This patch is mostly about the arrow syntax. Some places can not be updated because the arrow syntax also changes the meaning of `this.…`, but some code relies on that. Change-Id: Ida3ab0e0950a428fbd1a85f281013778ee879df4
35 lines
896 B
JavaScript
35 lines
896 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.mwEnvironment );
|
|
|
|
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 );
|
|
}
|
|
} );
|