mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-03 19:36:36 +00:00
17ab004262
A few modules had wrong (duplicated) names. Change-Id: Ib2ff195ee458a23d01e25a6cb1ff1b573dd9999a
28 lines
862 B
JavaScript
28 lines
862 B
JavaScript
( function () {
|
|
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 );
|
|
} );
|
|
}() );
|