mediawiki-extensions-Visual.../modules/ve-mw/tests/ce/ve.ce.Surface.test.js
James D. Forrester 497e7eb4a1 Update VE core submodule to master (cb06317)
New changes:
5197b2d Rangestate optimization
80a07cf Unmix GeneratedContentNode from AlienNodes
f510e9c Make (Node/Annotation/MetaItem)Factory inherit from ModelFactory
b625ff0 Localisation updates from https://translatewiki.net.
5c4653c ve.qunit: Use 'jscs:disable' comment rather than hacks
90e9480 Remove registration of abstract AlienNode classes
d325674 i18n/en.json: Convert from spaces to tabs, like all other files
f40fc15 Add 'classes' config option to focusable nodes to simplify AlienNode
f7c8999 Document config options as @cfg
ad3aa0b ve.ce.Surface.test: Groundwork for testing non-linear selections
cd1a992 Localisation updates from https://translatewiki.net.
c92471e Move drop marker to highlights layer and position absolutely

Change-Id: I437663d93a346a06c6a5137cce5149c7a6fcbb7f
2015-03-25 18:20:35 +00:00

42 lines
1.1 KiB
JavaScript

/*!
* VisualEditor ContentEditable MediaWiki-specific Surface tests.
*
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
* @license The MIT License (MIT); see LICENSE.txt
*/
QUnit.module( 've.ce.Surface (MW)' );
/* Tests */
QUnit.test( 'handleLinearDelete', function ( assert ) {
var i,
cases = [
// This asserts that getRelativeRange (via getRelativeOffset) doesn't try to
// enter a handleOwnChildren node
{
html:
ve.dm.mwExample.MWBlockImage.html +
'<ul><li><p>Foo</p></li><li><p>Bar</p></li></ul>',
range: new ve.Range( 12 ),
operations: ['backspace'],
// TODO: This action should probably unwrap the list item as
expectedData: function () {},
expectedSelection: {
type: 'linear',
range: new ve.Range( 12 )
},
msg: 'Backspace in a list next to a block image doesn\'t merge into the caption'
}
];
QUnit.expect( cases.length * 2 );
for ( i = 0; i < cases.length; i++ ) {
ve.test.utils.runSurfaceHandleSpecialKeyTest(
assert, cases[i].html, cases[i].range, cases[i].operations,
cases[i].expectedData, cases[i].expectedSelection, cases[i].msg
);
}
} );