/*! * VisualEditor ContentEditable Surface tests. * * @copyright 2011-2013 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 = [ { 'html': '
Foo
' + ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent + 'Bar
', 'range': new ve.Range( 4 ), 'operations': ['delete'], 'expectedData': function () {}, 'expectedRange': new ve.Range( 5, 7 ), 'msg': 'Block transclusion is focused not deleted' }, { 'html': 'Foo
' + ve.dm.mwExample.MWTransclusion.blockOpen + ve.dm.mwExample.MWTransclusion.blockContent + 'Bar
', 'range': new ve.Range( 4 ), 'operations': ['delete', 'delete'], 'expectedData': function ( data ) { data.splice( 5, 2 ); }, 'expectedRange': new ve.Range( 5, 5 ), 'msg': 'Block transclusion is deleted with two keypresses' }, { 'html': 'Foo
' + ve.dm.mwExample.MWBlockImage.html + 'Bar
', 'range': new ve.Range( 4 ), 'operations': ['delete'], 'expectedData': function () { }, 'expectedRange': new ve.Range( 5, 14 ), 'msg': 'Block image is focused not deleted' }, { 'html': ve.dm.mwExample.MWBlockImage.html + 'Foo
Bar