2020-11-20 07:46:57 +00:00
|
|
|
var PointerView = require( 'ext.RevisionSlider.Slider' ).private.PointerView;
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
QUnit.module( 'ext.RevisionSlider.PointerView' );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
QUnit.test( 'Initialize PointerView', function ( assert ) {
|
|
|
|
assert.ok( ( new PointerView( null, 'mw-revslider-pointer' ) ).render().hasClass( 'mw-revslider-pointer' ) );
|
|
|
|
} );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
QUnit.test( 'Is newer pointer', function ( assert ) {
|
|
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
|
|
pv.render();
|
|
|
|
assert.notOk( pv.isNewerPointer() );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
|
|
assert.ok( pv.isNewerPointer() );
|
|
|
|
} );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
QUnit.test( 'Has offset', function ( assert ) {
|
|
|
|
var pv = new PointerView( null, 'mw-revslider-pointer' );
|
|
|
|
pv.render();
|
|
|
|
assert.strictEqual( pv.getOffset(), 0 );
|
2016-05-26 10:30:12 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
|
|
assert.strictEqual( pv.getOffset(), 16 );
|
|
|
|
} );
|