mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/VisualEditor
synced 2024-11-25 06:46:26 +00:00
3528aeb8d3
Some modules had the same name as test modules in VE core, and this broke expand/collapse behavior in QUnit. Change-Id: I7fd0b454b3377b7c289ddebbf91146fcbe5945c4
30 lines
1 KiB
JavaScript
30 lines
1 KiB
JavaScript
/*!
|
|
* VisualEditor DataModel MediaWiki-specific SurfaceFragment tests.
|
|
*
|
|
* @copyright 2011-2015 VisualEditor Team and others; see AUTHORS.txt
|
|
* @license The MIT License (MIT); see LICENSE.txt
|
|
*/
|
|
|
|
QUnit.module( 've.dm.SurfaceFragment (MW)' );
|
|
|
|
/* Tests */
|
|
|
|
QUnit.test( 'isolateAndUnwrap (MWheading)', 2, function ( assert ) {
|
|
ve.test.utils.runIsolateTest( assert, 'mwHeading', new ve.Range( 12, 20 ), function ( data ) {
|
|
data.splice( 11, 0, { type: '/list' } );
|
|
data.splice( 12, 1 );
|
|
data.splice( 20, 1, { type: 'list', attributes: { style: 'bullet' } } );
|
|
}, 'isolating paragraph in list item "Item 2" for MWheading' );
|
|
|
|
ve.test.utils.runIsolateTest( assert, 'mwHeading', new ve.Range( 202, 212 ), function ( data ) {
|
|
data.splice( 201, 1,
|
|
{ type: '/list' }, { type: '/listItem' }, { type: '/list' }
|
|
);
|
|
data.splice( 214, 1,
|
|
{ type: 'list', attributes: { style: 'bullet' } },
|
|
{ type: 'listItem' },
|
|
{ type: 'list', attributes: { style: 'number' } }
|
|
);
|
|
}, 'isolating paragraph in list item "Nested 2" for MWheading' );
|
|
} );
|