mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/RevisionSlider
synced 2025-01-05 18:34:13 +00:00
a2774984c4
Changes include: - not passing in HTML attributes when creating tag elements, - creating HTML elements instead of appending hand-crafted HTML, - single append() calls instead of multiple consecutie appends, - not using raw HTML messages when not needed, - prefixing all CSS classes and IDs with "mw-" to avoid potential name conflicts. Change-Id: I164538bbaf44d46a4c66659f56e07ec7225d7fa9
28 lines
835 B
JavaScript
28 lines
835 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-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-upper-pointer' );
|
|
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-upper-pointer' );
|
|
assert.equal( pv.getOffset(), 16 );
|
|
} );
|
|
} )( mediaWiki );
|