'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', function ( 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

  1. Foo

  2. Bar ish

  3. Baz

` } ]; cases.forEach( function ( caseItem ) { ve.test.utils.runDiffElementTest( assert, caseItem ); } ); } );