Skip to content

Commit 4323c0a

Browse files
committed
update UTs
1 parent f860210 commit 4323c0a

1 file changed

Lines changed: 12 additions & 36 deletions

File tree

tests/unit/libs/EmojiUtilsTest.ts

Lines changed: 12 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -37,19 +37,19 @@ jest.mock('@assets/emojis', () => ({
3737
},
3838
emojiNameTable: {
3939
// eslint-disable-next-line @typescript-eslint/naming-convention
40-
'grinning_face': {
40+
grinning_face: {
4141
code: '😀',
4242
name: 'grinning_face',
4343
keywords: ['face', 'grin', 'grinning'],
4444
},
4545
// eslint-disable-next-line @typescript-eslint/naming-convention
46-
'waving_hand': {
46+
waving_hand: {
4747
code: '👋',
4848
name: 'waving_hand',
4949
keywords: ['hand', 'wave', 'waving'],
5050
},
5151
// eslint-disable-next-line @typescript-eslint/naming-convention
52-
'thumbs_up': {
52+
thumbs_up: {
5353
code: '👍',
5454
name: 'thumbs_up',
5555
keywords: ['hand', 'thumb', 'up'],
@@ -192,8 +192,8 @@ describe('processFrequentlyUsedEmojis', () => {
192192
code: '😀',
193193
name: 'grinning_face',
194194
keywords: ['face', 'grin', 'grinning'],
195-
count: 8,
196-
lastUpdatedAt: 2000,
195+
count: 8,
196+
lastUpdatedAt: 2000,
197197
});
198198
});
199199

@@ -257,30 +257,6 @@ describe('processFrequentlyUsedEmojis', () => {
257257
expect(result.at(2)?.code).toBe('😀');
258258
});
259259

260-
it('should handle emojis with skin tones correctly', () => {
261-
const input: FrequentlyUsedEmoji[] = [
262-
{
263-
code: '😀',
264-
name: 'grinning_face',
265-
count: 5,
266-
lastUpdatedAt: 1000,
267-
types: ['😀', '😀🏻', '😀🏼'],
268-
},
269-
];
270-
271-
const result = processFrequentlyUsedEmojis(input);
272-
273-
expect(result).toHaveLength(1);
274-
expect(result.at(0)).toEqual({
275-
code: '😀',
276-
name: 'grinning_face',
277-
keywords: ['face', 'grin', 'grinning'],
278-
count: 5,
279-
lastUpdatedAt: 1000,
280-
types: ['😀', '😀🏻', '😀🏼'],
281-
});
282-
});
283-
284260
it('should handle complex scenario with mixed data quality', () => {
285261
const input: FrequentlyUsedEmoji[] = [
286262
{
@@ -318,11 +294,11 @@ describe('processFrequentlyUsedEmojis', () => {
318294
const result = processFrequentlyUsedEmojis(input);
319295

320296
expect(result).toHaveLength(3);
321-
322-
expect(result.at(0)?.code).toBe('👍');
323-
expect(result.at(1)?.code).toBe('😀');
324-
expect(result.at(2)?.code).toBe('👋');
325-
expect(result.at(1)?.count).toBe(7);
326-
expect(result.at(1)?.lastUpdatedAt).toBe(1500);
297+
298+
expect(result.at(0)?.code).toBe('👍');
299+
expect(result.at(1)?.code).toBe('😀');
300+
expect(result.at(2)?.code).toBe('👋');
301+
expect(result.at(1)?.count).toBe(7);
302+
expect(result.at(1)?.lastUpdatedAt).toBe(1500);
327303
});
328-
});
304+
});

0 commit comments

Comments
 (0)