mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-12-25 12:33:19 +00:00
b7f92605b2
Change-Id: I7b56bc7a9a69f64073ab97bdb1911d17b328b8b8
42 lines
1.2 KiB
JavaScript
42 lines
1.2 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)', ve.test.utils.mwEnvironment );
|
|
|
|
/* 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
|
|
);
|
|
}
|
|
} );
|