Update VE core submodule to master

Also update MWConverter.test.js for test util changes.

New changes:
863288b Update OOjs UI to v0.1.0-pre (af97c1caec)
0bb2404 Refactor converter test utils to run single test cases

Change-Id: I90273786ac186df3eec13270f94d655b605bfdc4
This commit is contained in:
Roan Kattouw 2014-01-14 19:15:37 -08:00
parent 7c087176ac
commit b0cfb82369
2 changed files with 50 additions and 3 deletions

2
lib/ve

@ -1 +1 @@
Subproject commit 677574cc70b0107d4c5b984fe8198c63ff53d651
Subproject commit 04b9c67389540a75e2c4e935b886e8967e9859de

View file

@ -5,14 +5,61 @@
* @license The MIT License (MIT); see LICENSE.txt
*/
/*global mw */
QUnit.module( 've.dm.MWConverter' );
/* Tests */
function setMwConfig( newConfig ) {
var key, oldConfig = {};
for ( key in newConfig ) {
// Store orignal value
oldConfig[key] = mw.config.get( key );
// Override config setting
mw.config.set( key, newConfig[key] );
}
return oldConfig;
}
QUnit.test( 'getModelFromDom', function ( assert ) {
ve.test.utils.runGetModelFromDomTests( assert, ve.copy( ve.dm.mwExample.domToDataCases ) );
var msg, caseItem,
originalConfig,
cases = ve.dm.mwExample.domToDataCases;
QUnit.expect( ve.test.utils.countGetModelFromDomTests( cases ) );
for ( msg in cases ) {
caseItem = ve.copy( cases[msg] );
if ( caseItem.mwConfig ) {
originalConfig = setMwConfig( caseItem.mwConfig );
}
ve.test.utils.runGetModelFromDomTest( assert, caseItem );
if ( caseItem.mwConfig ) {
setMwConfig( originalConfig );
}
}
} );
QUnit.test( 'getDomFromModel', function ( assert ) {
ve.test.utils.runGetDomFromModelTests( assert, ve.copy( ve.dm.mwExample.domToDataCases ) );
var msg, caseItem,
originalConfig,
cases = ve.dm.mwExample.domToDataCases;
QUnit.expect( 2 * Object.keys( cases ).length );
for ( msg in cases ) {
caseItem = ve.copy( cases[msg] );
if ( caseItem.mwConfig ) {
originalConfig = setMwConfig( caseItem.mwConfig );
}
ve.test.utils.runGetDomFromModelTest( assert, caseItem );
if ( caseItem.mwConfig ) {
setMwConfig( originalConfig );
}
}
} );