/*!
* VisualEditor Cite-specific DiffElement tests.
*
* @copyright 2011-2018 VisualEditor Team and others; see http://ve.mit-license.org
*/
QUnit.module( 've.ui.DiffElement (Cite)' );
QUnit.test( 'Diffing', function ( assert ) {
var i, len,
spacer = '
⋮
',
ref = function ( text, num ) {
var dataMw = {
name: 'ref',
body: { html: text }
// attrs doesn't get set in preview mode
};
return '' +
'[' + num + ']' +
'';
},
cases = [
{
msg: 'Simple ref change',
oldDoc:
'' + ref( 'Foo' ) + ref( 'Bar' ) + ref( 'Baz' ) + '
' +
'Notes
' +
'',
newDoc:
'' + ref( 'Foo' ) + ref( 'Bar ish' ) + ref( 'Baz' ) + '
' +
'Notes
' +
'',
expected:
spacer +
'Notes
' +
'' +
'
' +
'Foo
' +
'
' +
'
' +
'Bar ish
' +
'
' +
'
' +
'Baz
' +
'
' +
'
'
}
];
for ( i = 0, len = cases.length; i < len; i++ ) {
ve.test.utils.runDiffElementTest( assert, cases[ i ] );
}
} );