mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-01 01:16:30 +00:00
Add missing FragmentInspector tests to MW
Requires unregistering MWLinkAnnotationInspector Bonus: Remove unnecessary list of unregsiters as teardownOverrides is run on init. Change-Id: I3e36ab7736cc8479ab53f40d2eb24c0fa15d3dc0
This commit is contained in:
parent
3542799ab4
commit
545c6f1301
|
@ -2651,6 +2651,7 @@
|
|||
"modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.MWWikitextStringTransferHandler.test.js",
|
||||
"modules/ve-mw/tests/ui/datatransferhandlers/ve.ui.UrlStringTransferHandler.test.js",
|
||||
"modules/ve-mw/tests/init/targets/ve.init.mw.DesktopArticleTarget.test.js",
|
||||
"lib/ve/tests/ui/inspectors/ve.ui.FragmentInspector.test.js",
|
||||
"lib/ve/tests/ce/ve.ce.TestRunner.js",
|
||||
"lib/ve/tests/ce/ve.ce.imetests.test.js",
|
||||
"lib/ve/tests/ce/imetests/backspace-chromium-ubuntu-none.js",
|
||||
|
|
|
@ -51,16 +51,6 @@
|
|||
};
|
||||
ve.test.utils.MWDummyPlatform = MWDummyPlatform;
|
||||
|
||||
// Unregister MW override nodes.
|
||||
// They are temporarily registered in setup/teardown.
|
||||
ve.dm.modelRegistry.unregister( ve.dm.MWHeadingNode );
|
||||
ve.dm.modelRegistry.unregister( ve.dm.MWPreformattedNode );
|
||||
ve.dm.modelRegistry.unregister( ve.dm.MWTableNode );
|
||||
ve.dm.modelRegistry.unregister( ve.dm.MWExternalLinkAnnotation );
|
||||
// Re-register unregistered nodes.
|
||||
ve.dm.modelRegistry.register( ve.dm.InlineImageNode );
|
||||
ve.dm.modelRegistry.register( ve.dm.BlockImageNode );
|
||||
|
||||
ve.test.utils.mwEnvironment = ( function () {
|
||||
var mwPlatform, corePlatform, mwTarget, coreTarget,
|
||||
setEditorPreference = mw.libs.ve.setEditorPreference,
|
||||
|
@ -94,6 +84,9 @@
|
|||
for ( i = 0; i < overridden.length; i++ ) {
|
||||
ve.dm.modelRegistry.unregister( overridden[ i ] );
|
||||
}
|
||||
ve.ui.windowFactory.unregister( ve.ui.LinkAnnotationInspector );
|
||||
ve.ui.windowFactory.register( ve.ui.MWLinkAnnotationInspector );
|
||||
|
||||
ve.init.platform = mwPlatform;
|
||||
ve.init.target = mwTarget;
|
||||
mw.libs.ve.setEditorPreference = dummySetEditorPreference;
|
||||
|
@ -110,6 +103,9 @@
|
|||
for ( i = 0; i < overridden.length; i++ ) {
|
||||
ve.dm.modelRegistry.register( overridden[ i ] );
|
||||
}
|
||||
ve.ui.windowFactory.unregister( ve.ui.MWLinkAnnotationInspector );
|
||||
ve.ui.windowFactory.register( ve.ui.LinkAnnotationInspector );
|
||||
|
||||
ve.init.platform = corePlatform;
|
||||
ve.init.target = coreTarget;
|
||||
mw.libs.ve.setEditorPreference = setEditorPreference;
|
||||
|
|
Loading…
Reference in a new issue