/*! * 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 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

' + '
    ' + '
  1. Foo

  2. ' + '
  3. Bar ish

  4. ' + '
  5. Baz

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