diff --git a/Gruntfile.js b/Gruntfile.js index 2e02fcaf..165e58cb 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -13,7 +13,7 @@ module.exports = function ( grunt ) { }, all: [ '*.js', - 'tests/*.js', + 'tests/**/*.js', 'modules/**/*.js' ] }, diff --git a/tests/qunit/RevisionSlider.HelpDialog.test.js b/tests/qunit/RevisionSlider.HelpDialog.test.js index 6d4c5cf3..066f5bd3 100644 --- a/tests/qunit/RevisionSlider.HelpDialog.test.js +++ b/tests/qunit/RevisionSlider.HelpDialog.test.js @@ -5,22 +5,21 @@ QUnit.test( 'Initialize HelpDialog', function ( assert ) { var helpDialog = new HelpDialog(), - windowManager = new OO.ui.WindowManager(), - dialogue = new HelpDialog(); + windowManager = new OO.ui.WindowManager(); + + function getSlideTextHtml( slide ) { + return slide.$element.find( '.mw-help-dialog-text' ).html(); + } $( 'body' ).append( windowManager.$element ); windowManager.addWindows( [ helpDialog ] ); assert.equal( helpDialog.slides.length, 4 ); assert.equal( helpDialog.slidePointer, 0 ); - assert.equal( getSlideTextHtml( helpDialog.slides[0] ), mw.message( 'revisionslider-help-dialog-slide1' ).parse() ); - assert.equal( getSlideTextHtml( helpDialog.slides[1] ), mw.message( 'revisionslider-help-dialog-slide2' ).parse() ); - assert.equal( getSlideTextHtml( helpDialog.slides[2] ), mw.message( 'revisionslider-help-dialog-slide3' ).parse() ); - assert.equal( getSlideTextHtml( helpDialog.slides[3] ), mw.message( 'revisionslider-help-dialog-slide4' ).parse() ); + assert.equal( getSlideTextHtml( helpDialog.slides[ 0 ] ), mw.message( 'revisionslider-help-dialog-slide1' ).parse() ); + assert.equal( getSlideTextHtml( helpDialog.slides[ 1 ] ), mw.message( 'revisionslider-help-dialog-slide2' ).parse() ); + assert.equal( getSlideTextHtml( helpDialog.slides[ 2 ] ), mw.message( 'revisionslider-help-dialog-slide3' ).parse() ); + assert.equal( getSlideTextHtml( helpDialog.slides[ 3 ] ), mw.message( 'revisionslider-help-dialog-slide4' ).parse() ); } ); - function getSlideTextHtml( slide ) { - return slide.$element.find( '.mw-help-dialog-text' ).html(); - } - } )( mediaWiki ); diff --git a/tests/qunit/RevisionSlider.RevisionListView.test.js b/tests/qunit/RevisionSlider.RevisionListView.test.js index b407cde4..145d1ab4 100644 --- a/tests/qunit/RevisionSlider.RevisionListView.test.js +++ b/tests/qunit/RevisionSlider.RevisionListView.test.js @@ -18,12 +18,12 @@ $revisionDivs = $resultHtml.find( '.mw-revision' ); assert.equal( $revisionWrapperDivs.length, 3 ); - assert.equal( $( $revisionDivs[0] ).attr( 'data-revid' ), 1 ); - assert.equal( $( $revisionDivs[2] ).attr( 'data-revid' ), 37 ); - assert.equal( $( $revisionDivs[1] ).css( 'width' ), '11px' ); - assert.equal( $( $revisionDivs[1] ).css( 'height' ), '70px' ); // max relative size - assert.ok( $( $revisionDivs[1] ).hasClass( 'mw-revision-up' ) ); - assert.ok( $( $revisionDivs[2] ).hasClass( 'mw-revision-down' ) ); + assert.equal( $( $revisionDivs[ 0 ] ).attr( 'data-revid' ), 1 ); + assert.equal( $( $revisionDivs[ 2 ] ).attr( 'data-revid' ), 37 ); + assert.equal( $( $revisionDivs[ 1 ] ).css( 'width' ), '11px' ); + assert.equal( $( $revisionDivs[ 1 ] ).css( 'height' ), '70px' ); // max relative size + assert.ok( $( $revisionDivs[ 1 ] ).hasClass( 'mw-revision-up' ) ); + assert.ok( $( $revisionDivs[ 2 ] ).hasClass( 'mw-revision-down' ) ); } ); QUnit.test( 'tool tip is composed correctly', function ( assert ) {