mediawiki-extensions-Revisi.../tests/qunit/RevisionSlider.PointerView.test.js
Ed Sanders 351bdcfae7 build: Update linters
Change-Id: If21c9dbeba945d54c6bcf9b6e4edd586c5b411ca
2018-09-13 21:58:39 +01:00

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 ) );