mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-13 07:48:37 +00:00
4a9ee131d3
Pointers can always be identified as the pointer for the "older" and "newer" revisions. Class nameing was cleaned up and changed accordingly. Change-Id: Id17878e780b5a405b196fdc5ec7429eeaef5bd4c
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 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.equal( pv.getOffset(), 0 );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
assert.equal( pv.getOffset(), 16 );
|
|
} );
|
|
}( mediaWiki ) );
|