mediawiki-extensions-Revisi.../tests/qunit/RevisionSlider.PointerView.test.js
Leszek Manicki 8e7fe2434d Add eslint, to be used instead of jscs and/or jshint
First I jumped on replacing both jscs and jshint with eslint but
it might be premature decision. Although linting with eslint
is possible (like in there is wikimedia config for eslint)
it is still not clear should it

But in case the change happens we will be ready.

Apart from config stuff this changes few bits spotted by eslint:
improves some indentation, removes weird spaces, completes some
doc blocks, changes IIFE forms in tests. These changes do not
seem controversial.

Change-Id: I9f8bf0f5745da8e662685f4cd879ea4baa609c01
2016-09-05 09:47:11 +02:00

28 lines
865 B
JavaScript

( function ( mw ) {
var PointerView = mw.libs.revisionSlider.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 upper pointer', function ( assert ) {
var pv = new PointerView( null, 'mw-revslider-pointer' );
pv.render();
assert.notOk( pv.isUpperPointer() );
pv.getElement().addClass( 'mw-revslider-pointer-upper' );
assert.ok( pv.isUpperPointer() );
} );
QUnit.test( 'Has offset', function ( assert ) {
var pv = new PointerView( null, 'mw-revslider-pointer' );
pv.render();
assert.equal( pv.getOffset(), 0 );
pv.getElement().addClass( 'mw-revslider-pointer-upper' );
assert.equal( pv.getOffset(), 16 );
} );
}( mediaWiki ) );