'use strict';
/*!
* 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', ( assert ) => {
const spacer = '
⋮
',
ref = function ( text, num ) {
const dataMw = {
name: 'ref',
body: { html: text }
// attrs doesn't get set in preview mode
};
return '' +
'[' + num + ']' +
'';
},
cases = [
{
msg: 'Simple ref change',
oldDoc: ve.dm.example.singleLine`
${ ref( 'Foo' ) }${ ref( 'Bar' ) }${ ref( 'Baz' ) }
Notes
`,
newDoc: ve.dm.example.singleLine`
${ ref( 'Foo' ) }${ ref( 'Bar ish' ) }${ ref( 'Baz' ) }
Notes
`,
expected: ve.dm.example.singleLine`
${ spacer }
Notes
Foo
- Bar ish
Baz
`
}
];
cases.forEach( ( caseItem ) => {
ve.test.utils.runDiffElementTest( assert, caseItem );
} );
} );