mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-11-15 03:33:45 +00:00
351bdcfae7
Change-Id: If21c9dbeba945d54c6bcf9b6e4edd586c5b411ca
28 lines
877 B
JavaScript
28 lines
877 B
JavaScript
( function ( mw ) {
|
|
var PointerView = mw.libs.revisionSlider.PointerView;
|
|
|
|
QUnit.module( 'ext.RevisionSlider.PointerView' );
|
|
|
|
QUnit.test( 'Initialize PointerView', function ( assert ) {
|
|
assert.ok( ( new PointerView( null, 'mw-revslider-pointer' ) ).render().hasClass( 'mw-revslider-pointer' ) );
|
|
} );
|
|
|
|
QUnit.test( 'Is newer pointer', function ( assert ) {
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
pv.render();
|
|
assert.notOk( pv.isNewerPointer() );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
assert.ok( pv.isNewerPointer() );
|
|
} );
|
|
|
|
QUnit.test( 'Has offset', function ( assert ) {
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
pv.render();
|
|
assert.strictEqual( pv.getOffset(), 0 );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
assert.strictEqual( pv.getOffset(), 16 );
|
|
} );
|
|
}( mediaWiki ) );
|