mirror of
https://github.com/signalapp/Signal-Desktop.git
synced 2025-12-24 20:26:24 +00:00
Rename files
This commit is contained in:
25
ts/test-node/components/fun/emojis_test.node.ts
Normal file
25
ts/test-node/components/fun/emojis_test.node.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
// Copyright 2025 Signal Messenger, LLC
|
||||
// SPDX-License-Identifier: AGPL-3.0-only
|
||||
import assert from 'node:assert/strict';
|
||||
import { getEmojifyData } from '../../../components/fun/data/emojis.std.js';
|
||||
|
||||
describe('getEmojifyData', () => {
|
||||
function check(text: string, emojiCount: number, isEmojiOnlyText: boolean) {
|
||||
assert.deepEqual(getEmojifyData(text), {
|
||||
text,
|
||||
emojiCount,
|
||||
isEmojiOnlyText,
|
||||
});
|
||||
}
|
||||
|
||||
it('empty strings', () => check('', 0, false));
|
||||
it('no emojis', () => check('abc', 0, false));
|
||||
it('emoji-like chars', () => check('®', 0, false));
|
||||
it('one emoji', () => check('❤️', 1, true));
|
||||
it('multiple emojis', () => check('❤️❤️❤️', 3, true));
|
||||
it('emojis + leading text', () => check('leading❤️', 1, false));
|
||||
it('emojis + trailing text', () => check('❤️trailing', 1, false));
|
||||
it('emojis + middle text', () => check('❤️middle❤️', 2, false));
|
||||
it('lots of emoji', () => check('❤️'.repeat(1000), 1000, true));
|
||||
it('lots of text + emoji', () => check(`${'a'.repeat(1000)}❤️`, 1, false));
|
||||
});
|
||||
Reference in New Issue
Block a user