mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2024-12-20 02:40:59 +00:00
b900446572
Reintroduces IIFE closures in test files because variables were declared in the global namespace, and "const" now causes hard errors. Bug: T339323 Change-Id: I69e9d7a29591137f185f3e5ab02dea590ec4dff6
18 lines
517 B
JavaScript
18 lines
517 B
JavaScript
( function () {
|
|
const Pointer = require( 'ext.RevisionSlider.Slider' ).private.Pointer;
|
|
|
|
QUnit.module( 'ext.RevisionSlider.Pointer' );
|
|
|
|
QUnit.test( 'Initialize Pointer', function ( assert ) {
|
|
assert.true( ( new Pointer( 'mw-revslider-pointer' ) ).getView().render().hasClass( 'mw-revslider-pointer' ) );
|
|
} );
|
|
|
|
QUnit.test( 'Set and get position', function ( assert ) {
|
|
const pointer = new Pointer(),
|
|
pos = 42;
|
|
|
|
pointer.setPosition( pos );
|
|
assert.strictEqual( pointer.getPosition(), pos );
|
|
} );
|
|
}() );
|