Pass mw.Title to #click in tests

Change-Id: I616d13bf11ce38ac9bd400a568ab791a07cf0392
This commit is contained in:
Ed Sanders 2018-04-24 15:28:02 +01:00 committed by Jforrester
parent 2078fbfb53
commit 9987491fdf

View file

@ -132,7 +132,7 @@
// trigger first click, which will cause MMV to be loaded (which we've
// set up to fail)
event = new $.Event( 'click', { button: 0, which: 1 } );
returnValue = bootstrap.click( {}, event, 'foo' );
returnValue = bootstrap.click( {}, event, mw.Title.newFromText( 'Foo' ) );
clock.tick( 10 );
assert.ok( event.isDefaultPrevented(), 'First click is caught' );
assert.strictEqual( returnValue, false, 'First click is caught' );
@ -140,7 +140,7 @@
// wait until MMW is loaded (or failed to load, in this case) before we
// trigger another click - which should then not be caught
event = new $.Event( 'click', { button: 0, which: 1 } );
returnValue = bootstrap.click( {}, event, 'foo' );
returnValue = bootstrap.click( {}, event, mw.Title.newFromText( 'Foo' ) );
clock.tick( 10 );
assert.ok( !event.isDefaultPrevented(), 'Click after loading failure is not caught' );
assert.notStrictEqual( returnValue, false, 'Click after loading failure is not caught' );