From bfc705be8f60c542e74cef09dccc8fca675f6473 Mon Sep 17 00:00:00 2001 From: YashRE42 <33805964+YashRE42@users.noreply.github.com> Date: Sun, 21 Nov 2021 00:30:38 +0530 Subject: [PATCH] reactions_tests: Remove misleading emoji_params.realm_emoji.zulip obj. Previously, this test file had an object that encouraged one to believe that it is defining a realm_emoji with the name, id = "zulip" and a custom source url, but this is false. The "zulip" emoji is a special case that's added to our data structures by the `/shared/emoji.js` code. Notice how the test never asserts that the returned url is equal to the source_url defined, it just asserts that the source url is equal to "/static/generated/emoji/images/emoji/unicode/zulip.png" (which is the value defined in `/share/emoji.js`). Hence, we remove this object and replace any references to it with the values defined in `/shared/emoji.js`. --- frontend_tests/node_tests/reactions.js | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-) diff --git a/frontend_tests/node_tests/reactions.js b/frontend_tests/node_tests/reactions.js index 8792cccaea..fe092f4929 100644 --- a/frontend_tests/node_tests/reactions.js +++ b/frontend_tests/node_tests/reactions.js @@ -80,12 +80,6 @@ const emoji_params = { source_url: "/url/for/992", deactivated: true, }, - zulip: { - id: "zulip", - name: "zulip", - source_url: "/url/for/zulip", - deactivated: false, - }, }, emoji_codes, }; @@ -621,14 +615,12 @@ test("view.insert_new_reaction (me w/unicode emoji)", ({override, mock_template} }); test("view.insert_new_reaction (them w/zulip emoji)", ({override, mock_template}) => { - const zulip_emoji = emoji_params.realm_emoji.zulip; const opts = { message_id: 502, reaction_type: "realm_emoji", emoji_name: "zulip", - emoji_code: zulip_emoji.id, + emoji_code: "zulip", user_id: bob.user_id, - source_url: zulip_emoji.source_url, }; const message_reactions = $.create("our-reactions");