mediawiki-extensions-Revisi.../tests/qunit/RevisionSlider.PointerView.test.js
thiemowmde 759c081add Drop separate .render/.initialize logic from View classes
Most callers use it as if it's a `getElement` call anyway.

There is one .initialize method left in the HelpDialog class. That's
part of the upstream OOUI Window interfaces.

Change-Id: I5727c59ad0ad05d712d51d255906ddc44e898668
2024-02-26 20:40:28 +00:00

19 lines
623 B
JavaScript

( function () {
const PointerView = require( 'ext.RevisionSlider.Slider' ).private.PointerView;
QUnit.module( 'ext.RevisionSlider.PointerView' );
QUnit.test( 'Initialize PointerView', function ( assert ) {
assert.true( ( new PointerView( null, 'mw-revslider-pointer' ) ).getElement().hasClass( 'mw-revslider-pointer' ) );
} );
QUnit.test( 'Is newer pointer', function ( assert ) {
const pv = new PointerView( null, 'mw-revslider-pointer' );
pv.getElement();
assert.false( pv.isNewerPointer() );
pv.getElement().addClass( 'mw-revslider-pointer-newer' );
assert.true( pv.isNewerPointer() );
} );
}() );