mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-11 06:56:09 +00:00
ddcd65f4de
Change-Id: I8e06c9eeb47688741a95bca8f996b2148b03028c
28 lines
879 B
JavaScript
28 lines
879 B
JavaScript
( function () {
|
|
var PointerView = require( 'ext.RevisionSlider.Pointer' ).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 );
|
|
} );
|
|
}() );
|