2020-11-18 09:11:12 +00:00
|
|
|
QUnit.module( 'ext.RevisionSlider.HelpDialog' );
|
2016-06-29 10:43:46 +00:00
|
|
|
|
2024-06-08 04:13:35 +00:00
|
|
|
QUnit.test( 'Initialize HelpDialog', ( assert ) => {
|
2023-06-22 09:41:37 +00:00
|
|
|
const HelpDialog = require( 'ext.RevisionSlider.Slider' ).HelpDialog;
|
|
|
|
const helpDialog = new HelpDialog(),
|
2020-11-18 09:11:12 +00:00
|
|
|
windowManager = new OO.ui.WindowManager();
|
2016-07-01 10:24:30 +00:00
|
|
|
|
2023-04-21 07:03:07 +00:00
|
|
|
$( document.body ).append( windowManager.$element );
|
2020-11-18 09:11:12 +00:00
|
|
|
windowManager.addWindows( [ helpDialog ] );
|
2016-06-29 10:43:46 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
assert.strictEqual( helpDialog.slides.length, 4 );
|
|
|
|
assert.strictEqual( helpDialog.slidePointer, 0 );
|
2024-04-29 09:58:06 +00:00
|
|
|
|
2020-11-18 09:11:12 +00:00
|
|
|
assert.strictEqual(
|
2024-04-29 09:58:06 +00:00
|
|
|
helpDialog.slides[ 0 ].$element.find( '.mw-revslider-help-dialog-text' ).text(),
|
|
|
|
'(revisionslider-help-dialog-slide1)'
|
2020-11-18 09:11:12 +00:00
|
|
|
);
|
|
|
|
assert.strictEqual(
|
2024-04-29 09:58:06 +00:00
|
|
|
helpDialog.slides[ 1 ].$element.find( '.mw-revslider-help-dialog-text' ).text(),
|
|
|
|
'(revisionslider-help-dialog-slide2)'
|
2020-11-18 09:11:12 +00:00
|
|
|
);
|
|
|
|
assert.strictEqual(
|
2024-04-29 09:58:06 +00:00
|
|
|
helpDialog.slides[ 2 ].$element.find( '.mw-revslider-help-dialog-text' ).text(),
|
|
|
|
'(revisionslider-help-dialog-slide3a)'
|
2020-11-18 09:11:12 +00:00
|
|
|
);
|
|
|
|
assert.strictEqual(
|
2024-04-29 09:58:06 +00:00
|
|
|
helpDialog.slides[ 3 ].$element.find( '.mw-revslider-help-dialog-text' ).text(),
|
|
|
|
'(revisionslider-help-dialog-slide4)'
|
2020-11-18 09:11:12 +00:00
|
|
|
);
|
|
|
|
} );
|