2023-06-22 09:41:37 +00:00
|
|
|
( function () {
|
|
|
|
const PointerView = require( 'ext.RevisionSlider.Slider' ).private.PointerView;
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2023-06-22 09:41:37 +00:00
|
|
|
QUnit.module( 'ext.RevisionSlider.PointerView' );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2023-06-22 09:41:37 +00:00
|
|
|
QUnit.test( 'Initialize PointerView', function ( assert ) {
|
2024-02-21 17:40:07 +00:00
|
|
|
assert.true( ( new PointerView( null, 'mw-revslider-pointer' ) ).getElement().hasClass( 'mw-revslider-pointer' ) );
|
2023-06-22 09:41:37 +00:00
|
|
|
} );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2023-06-22 09:41:37 +00:00
|
|
|
QUnit.test( 'Is newer pointer', function ( assert ) {
|
|
|
|
const pv = new PointerView( null, 'mw-revslider-pointer' );
|
2024-02-21 17:40:07 +00:00
|
|
|
pv.getElement();
|
2023-06-22 09:41:37 +00:00
|
|
|
assert.false( pv.isNewerPointer() );
|
2016-05-03 11:26:42 +00:00
|
|
|
|
2023-06-22 09:41:37 +00:00
|
|
|
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
|
|
|
|
assert.true( pv.isNewerPointer() );
|
|
|
|
} );
|
|
|
|
}() );
|