mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-15 18:39:52 +00:00
69ae829737
Add comment to remaining test explaning its purpose. Depends on Id7c291b in core. Change-Id: Ia545edac3b2adbd6d45ed5427a9e5e6f9df0da54
39 lines
1.1 KiB
JavaScript
39 lines
1.1 KiB
JavaScript
/*!
|
|
* VisualEditor ContentEditable MediaWiki-specific Surface tests.
|
|
*
|
|
* @copyright 2011-2014 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
QUnit.module( 've.ce.Surface' );
|
|
|
|
/* Tests */
|
|
|
|
QUnit.test( 'handleDelete', 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 () {},
|
|
expectedRange: 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].expectedRange, cases[i].msg
|
|
);
|
|
}
|
|
} );
|