mediawiki-extensions-Revisi.../tests/qunit/RevisionSlider.PointerView.test.js
Thiemo Kreuz 319061c92a Merge ….Pointer ResourceLoader module away
It's never used in another context but together with the
….Slider module.

Motivated by the confusion about the two types of require()
introduced in Idf1cc79.

Bug: T233279
Change-Id: I7c98a41051e6d83ab3524cb14a709002feec2d78
2021-12-16 16:39:07 +01:00

26 lines
844 B
JavaScript

var PointerView = require( 'ext.RevisionSlider.Slider' ).private.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 );
} );