emoji: Refactor get_emoji_details_by_name function.

This is a prep commit for typescript migration of `emoji.js`. This
commit refactors the code for generating emoji rendering details such
that we avoid writing an ugly code which will involve writing an
incomplete type object when we migrate to TypeScript.
This commit is contained in:
Lalit
2023-04-05 16:21:26 +05:30
committed by Tim Abbott
parent 30204ed694
commit 6f46c4830f
3 changed files with 21 additions and 20 deletions

View File

@@ -76,6 +76,7 @@ run_test("get_emoji_details_by_name", () => {
reaction_type: "zulip_extra_emoji",
emoji_code: "zulip",
url: "/static/generated/emoji/images/emoji/unicode/zulip.png",
still_url: null,
});
// Test adding realm emoji.
@@ -97,6 +98,7 @@ run_test("get_emoji_details_by_name", () => {
reaction_type: "realm_emoji",
emoji_code: "102",
url: "/some/path/to/emoji",
still_url: null,
});
// Test sending without emoji name.