From ccf2f74fa12bd2dc0147e60115c9b340fb1ab775 Mon Sep 17 00:00:00 2001 From: NovemLinguae Date: Mon, 9 Dec 2024 02:32:21 -0800 Subject: [PATCH] shorten function name --- modules/twinkleblock.js | 4 ++-- tests/twinkleblock.test.js | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/modules/twinkleblock.js b/modules/twinkleblock.js index 8e831dab0..b780cb172 100644 --- a/modules/twinkleblock.js +++ b/modules/twinkleblock.js @@ -1899,7 +1899,7 @@ Twinkle.block.callback.issue_template = function twinkleblockCallbackIssueTempla // "talk page" of an IP range (which does not exist) const userTalkPage = 'User_talk:' + mw.config.get('wgRelevantUserName'); - const params = Twinkle.block.callback.combineFormDataAndFieldTemplateOptions( + const params = Twinkle.block.combineFormDataAndFieldTemplateOptions( formData, Twinkle.block.blockPresetsInfo[formData.template], Twinkle.block.field_template_options.block_reason, @@ -1916,7 +1916,7 @@ Twinkle.block.callback.issue_template = function twinkleblockCallbackIssueTempla wikipedia_page.load(Twinkle.block.callback.main); }; -Twinkle.block.callback.combineFormDataAndFieldTemplateOptions = function(formData, messageData, reason, disabletalk, noemail, nocreate) { +Twinkle.block.combineFormDataAndFieldTemplateOptions = function(formData, messageData, reason, disabletalk, noemail, nocreate) { return $.extend(formData, { messageData: messageData, reason: reason, diff --git a/tests/twinkleblock.test.js b/tests/twinkleblock.test.js index 05c17154c..732af83da 100644 --- a/tests/twinkleblock.test.js +++ b/tests/twinkleblock.test.js @@ -1,5 +1,5 @@ describe('modules/twinkleblock', () => { - describe('callback.combineFormDataAndFieldTemplateOptions', () => { + describe('combineFormDataAndFieldTemplateOptions', () => { // https://github.com/wikimedia-gadgets/twinkle/issues/2106 test('regression test: merging true and undefined should return true', () => { const formData = {disabletalk: true}; @@ -9,7 +9,7 @@ describe('modules/twinkleblock', () => { const noemail = undefined; const nocreate = undefined; const expected = {disabletalk: true}; - expect(Twinkle.block.callback.combineFormDataAndFieldTemplateOptions(formData, messageData, reason, disabletalk, noemail, nocreate)).toStrictEqual(expected); + expect(Twinkle.block.combineFormDataAndFieldTemplateOptions(formData, messageData, reason, disabletalk, noemail, nocreate)).toStrictEqual(expected); }); }); });