-
Notifications
You must be signed in to change notification settings - Fork 1
/
emoji.spec.ts
33 lines (28 loc) · 1.09 KB
/
emoji.spec.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
// Emoji.getEmojiFromJSON.test.js
import { getEmojiFromJSON } from "./emoji";
describe("Emoji.getEmojiFromJSON", () => {
it("should handle input with Megaphone", () => {
const input = "Megaphone";
const expectedOutput = "📣"; // Assuming this is the default
const result = getEmojiFromJSON(input);
expect(result).toBe(expectedOutput);
});
it("should handle input with :eyes:", () => {
const input = ":eyes:";
const expectedOutput = "👀"; // Assuming this is the correct emoji for :sad:
const result = getEmojiFromJSON(input);
expect(result).toBe(expectedOutput);
});
it("should handle undefined input and return null", () => {
const input = undefined;
const expectedOutput = null;
const result = getEmojiFromJSON(input);
expect(result).toBe(expectedOutput);
});
it("should handle null input and return null", () => {
const input = null;
const expectedOutput = null;
const result = getEmojiFromJSON(input);
expect(result).toBe(expectedOutput);
});
});