mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-12 07:25:13 +00:00
a5f36af0f3
Bug: T139105 Change-Id: Ia92396ec4f8acea39398173c81842d66257dc519
28 lines
865 B
JavaScript
28 lines
865 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 upper pointer', function ( assert ) {
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
pv.render();
|
|
assert.notOk( pv.isUpperPointer() );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-upper' );
|
|
assert.ok( pv.isUpperPointer() );
|
|
} );
|
|
|
|
QUnit.test( 'Has offset', function ( assert ) {
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
pv.render();
|
|
assert.equal( pv.getOffset(), 0 );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-upper' );
|
|
assert.equal( pv.getOffset(), 16 );
|
|
} );
|
|
} )( mediaWiki );
|