mediawiki-extensions-Revisi.../tests/qunit/RevisionSlider.Pointer.test.js
Adam Wight b900446572 Migrate JS to ES6
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
2023-06-23 08:01:31 +02:00

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 );
} );
}() );