[MediaWiki-commits] [Gerrit] Fix share/embed QUnit tests on 1.24wmf5 - change (mediawiki...MultimediaViewer)
Gilles has uploaded a new change for review. https://gerrit.wikimedia.org/r/134807 Change subject: Fix share/embed QUnit tests on 1.24wmf5 .. Fix share/embed QUnit tests on 1.24wmf5 Change-Id: Ia305d64a28f2e6aa3f181389b9a91df026cecef2 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/643 --- M tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js M tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js 2 files changed, 10 insertions(+), 9 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MultimediaViewer refs/changes/07/134807/1 diff --git a/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js b/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js index b1f12f3..e60c93e 100644 --- a/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js +++ b/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js @@ -295,8 +295,9 @@ }; // Triggering action events before attaching should do nothing - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + // use of focus() would run into jQuery bug #14740 and similar issues + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); @@ -316,8 +317,8 @@ embed.attach(); // Action events should be handled now - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); @@ -338,8 +339,8 @@ embed.unattach(); // Triggering action events now that we are unattached should do nothing - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); diff --git a/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js b/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js index 9558a29..2c85ff7 100644 --- a/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js +++ b/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js @@ -69,7 +69,7 @@ }; // Triggering action events before attaching should do nothing - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); share.selectAllOnEvent = function () { assert.ok( true, 'selectAllOnEvent was called.' ); @@ -78,7 +78,7 @@ share.attach(); // Action events should be handled now - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); // Test the unattach part share.selectAllOnEvent = function() { @@ -88,7 +88,7 @@ share.unattach(); // Triggering action events now that we are unattached should do nothing - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); } ); }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/134807 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ia305d64a28f2e6aa3f181389b9a91df026cecef2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: wmf/1.24wmf5 Gerrit-Owner: Gilles ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] Fix share/embed QUnit tests on 1.24wmf5 - change (mediawiki...MultimediaViewer)
jenkins-bot has submitted this change and it was merged. Change subject: Fix share/embed QUnit tests on 1.24wmf5 .. Fix share/embed QUnit tests on 1.24wmf5 Change-Id: Ia305d64a28f2e6aa3f181389b9a91df026cecef2 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/643 --- M tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js M tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js 2 files changed, 10 insertions(+), 9 deletions(-) Approvals: Anomie: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js b/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js index b1f12f3..e60c93e 100644 --- a/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js +++ b/tests/qunit/mmv/ui/mmv.ui.reuse.embed.test.js @@ -295,8 +295,9 @@ }; // Triggering action events before attaching should do nothing - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + // use of focus() would run into jQuery bug #14740 and similar issues + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); @@ -316,8 +317,8 @@ embed.attach(); // Action events should be handled now - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); @@ -338,8 +339,8 @@ embed.unattach(); // Triggering action events now that we are unattached should do nothing - embed.embedTextHtml.$element.focus(); - embed.embedTextWikitext.$element.focus(); + embed.embedTextHtml.$element.find( 'textarea' ).triggerHandler( 'focus' ); + embed.embedTextWikitext.$element.find( 'textarea' ).triggerHandler( 'focus' ); embed.embedSwitch.emit( 'select' ); embed.embedSizeSwitchHtml.getMenu().emit( 'choose', embed.embedSizeSwitchHtml.getMenu().getSelectedItem() ); diff --git a/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js b/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js index 9558a29..2c85ff7 100644 --- a/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js +++ b/tests/qunit/mmv/ui/mmv.ui.reuse.share.test.js @@ -69,7 +69,7 @@ }; // Triggering action events before attaching should do nothing - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); share.selectAllOnEvent = function () { assert.ok( true, 'selectAllOnEvent was called.' ); @@ -78,7 +78,7 @@ share.attach(); // Action events should be handled now - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); // Test the unattach part share.selectAllOnEvent = function() { @@ -88,7 +88,7 @@ share.unattach(); // Triggering action events now that we are unattached should do nothing - share.pageInput.$element.focus(); + share.pageInput.$element.find( 'input' ).triggerHandler( 'focus' ); } ); }( mediaWiki, jQuery ) ); -- To view, visit https://gerrit.wikimedia.org/r/134807 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Ia305d64a28f2e6aa3f181389b9a91df026cecef2 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/extensions/MultimediaViewer Gerrit-Branch: wmf/1.24wmf5 Gerrit-Owner: Gilles Gerrit-Reviewer: Anomie Gerrit-Reviewer: jenkins-bot <> ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits