mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-12 15:35:11 +00:00
1fa153aeab
The new mw eslint config comes with node 12 and the change will be quite big due to the lock file. I wanted to keep the diff of actual code changes seperate. - Applied all code style recommendations - Removed one test that's not giving any value - Changed regex .match to .test for performance and convinience Change-Id: I578be8c6460c7a4d1220354c028a9bfd9bb86d13
26 lines
848 B
JavaScript
26 lines
848 B
JavaScript
var PointerView = require( 'ext.RevisionSlider.Slider' ).private.PointerView;
|
|
|
|
QUnit.module( 'ext.RevisionSlider.PointerView' );
|
|
|
|
QUnit.test( 'Initialize PointerView', function ( assert ) {
|
|
assert.true( ( 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.false( pv.isNewerPointer() );
|
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
assert.true( 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 );
|
|
} );
|