mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 17:36:35 +00:00
f850ddf73b
All other repositories have tests in “tests” folder. For more information see: http://lists.wikimedia.org/pipermail/qa/2014-July/001663.html http://lists.wikimedia.org/pipermail/qa/2014-July/001667.html http://lists.wikimedia.org/pipermail/qa/2014-July/001672.html Change-Id: Ib1e4fa4b7203bd8217615db1ceac23a329c081f1
20 lines
658 B
JavaScript
20 lines
658 B
JavaScript
/*!
|
|
* VisualEditor MediaWiki test utilities.
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
ve.test.utils.createSurfaceFromDocument = function ( doc ) {
|
|
// Prevent the target from setting up the surface immediately
|
|
ve.init.platform.initialized = null;
|
|
// HACK: MW targets are async and heavy, use an SA target but
|
|
// override the global registration
|
|
var target = new ve.init.sa.Target( $( '#qunit-fixture' ), doc ),
|
|
mwTarget = new ve.init.mw.Target( $( '<div>' ).appendTo( $( '#qunit-fixture' ) ) );
|
|
|
|
mwTarget = null;
|
|
target.setup( doc );
|
|
return target.surface;
|
|
};
|