mediawiki-extensions-Revisi.../tests/RevisionSlider.Pointer.test.js
Jakob Warkotsch 54720944a0 Create Pointer module.
This creates a module for the draggable pointers for the RevisionSlider
mainly to encapsulate both the pointers' state and their HTML code.

Some animation methods such as slideToSide and slideToPosition
that are still flying around in init.js weren't added to the
module since I thought they should be part of the not yet existing
Slider module.

Change-Id: I1292bfb0bbd68f8d2de04b3b5e5f3133ec6363b8
2016-05-06 12:37:01 +00:00

19 lines
479 B
JavaScript

( function ( mw ) {
var Pointer = mw.libs.revisionSlider.Pointer;
QUnit.module( 'ext.RevisionSlider.Revision' );
QUnit.test( 'Initialize Pointer', function ( assert ) {
assert.ok( ( new Pointer( 'left-pointer' ) ).getView().render().find( '.left-pointer' ) );
} );
QUnit.test( 'Set and get position', function ( assert ) {
var pointer = new Pointer(),
pos = 42;
pointer.setPosition( pos );
assert.equal( pointer.getPosition(), pos );
} );
} )( mediaWiki );