[MediaWiki-commits] [Gerrit] mediawiki.util: Remove test for jsMessage - change (mediawiki/core)
Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/175949 Change subject: mediawiki.util: Remove test for jsMessage .. mediawiki.util: Remove test for jsMessage jsMessage uses mw.notify, which involves an animation. mw.notify yields an mw.Notification object which has a reference to the relevant elements. However the deprecated jsMessage wrapper only returns boolean, so we have no link to the element and no way to wait for the animation to finish. We could set up a mock clock in the test to skip the animation. However, in this case the test was already useless as method isn't testable (hardcoded booolean return). This test was causing the QUnit test suite to fail occasionally as the mw.notify animation was unfinished and would leak into other tests. Change-Id: Iffa91a3969bf69264b585e27ca44f85883ae2892 --- M tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 1 file changed, 0 insertions(+), 7 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/mediawiki/core refs/changes/49/175949/1 diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js index 9b620de..7aa9133 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js @@ -228,13 +228,6 @@ assert.equal( tbRLDMemptyjquery, $( '#p-test-tb li:last' )[0], 'Fallback to adding at the end (nextnode as empty jQuery object)' ); } ); - QUnit.test( 'jsMessage', 1, function ( assert ) { - this.suppressWarnings(); - var a = mw.util.jsMessage( 'MediaWiki is bAwesome/b.' ); - this.restoreWarnings(); - assert.ok( a, 'Basic checking of return value' ); - } ); - QUnit.test( 'validateEmail', 6, function ( assert ) { assert.strictEqual( mw.util.validateEmail( '' ), null, 'Should return null for empty string ' ); assert.strictEqual( mw.util.validateEmail( 'user@localhost' ), true, 'Return true for a valid e-mail address' ); -- To view, visit https://gerrit.wikimedia.org/r/175949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Iffa91a3969bf69264b585e27ca44f85883ae2892 Gerrit-PatchSet: 1 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
[MediaWiki-commits] [Gerrit] mediawiki.util: Remove test for jsMessage - change (mediawiki/core)
jenkins-bot has submitted this change and it was merged. Change subject: mediawiki.util: Remove test for jsMessage .. mediawiki.util: Remove test for jsMessage jsMessage uses mw.notify, which involves an animation. mw.notify yields an mw.Notification object which has a reference to the relevant elements. However the deprecated jsMessage wrapper only returns boolean, so we have no link to the element and no way to wait for the animation to finish. We could set up a mock clock in the test to skip the animation. However, in this case the test was already useless as method isn't testable (hardcoded booolean return). This test was causing the QUnit test suite to fail occasionally as the mw.notify animation was unfinished and would leak into other tests. Change-Id: Iffa91a3969bf69264b585e27ca44f85883ae2892 --- M tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js 1 file changed, 0 insertions(+), 7 deletions(-) Approvals: Mattflaschen: Looks good to me, approved jenkins-bot: Verified diff --git a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js index 9b620de..7aa9133 100644 --- a/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js +++ b/tests/qunit/suites/resources/mediawiki/mediawiki.util.test.js @@ -228,13 +228,6 @@ assert.equal( tbRLDMemptyjquery, $( '#p-test-tb li:last' )[0], 'Fallback to adding at the end (nextnode as empty jQuery object)' ); } ); - QUnit.test( 'jsMessage', 1, function ( assert ) { - this.suppressWarnings(); - var a = mw.util.jsMessage( 'MediaWiki is bAwesome/b.' ); - this.restoreWarnings(); - assert.ok( a, 'Basic checking of return value' ); - } ); - QUnit.test( 'validateEmail', 6, function ( assert ) { assert.strictEqual( mw.util.validateEmail( '' ), null, 'Should return null for empty string ' ); assert.strictEqual( mw.util.validateEmail( 'user@localhost' ), true, 'Return true for a valid e-mail address' ); -- To view, visit https://gerrit.wikimedia.org/r/175949 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: Iffa91a3969bf69264b585e27ca44f85883ae2892 Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/core Gerrit-Branch: master Gerrit-Owner: Krinkle krinklem...@gmail.com Gerrit-Reviewer: Mattflaschen mflasc...@wikimedia.org Gerrit-Reviewer: jenkins-bot ___ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits