Echo 852a08ab36 [Glitch] Improve emoji search
Port cf46401689b3122d0c310ea2b1c639ad151780f6 to glitch-soc

Signed-off-by: Claire <claire.github-309c@sitedethib.com>
2026-08-14 07:27:21 -04:00

38 lines
783 B
TypeScript

import { textAtCursorMatchesToken } from './utils';
describe('textAtCursorMatchesToken', () => {
test.concurrent.for([
[
['#hashtag', 7, ['#']],
[1, '#hashtag'],
],
[
['#hash tag', 8, ['#']],
[1, '#hash tag'],
],
[
[':+1', 2, [':']],
[1, ':+1'],
],
[
[':-1', 2, [':']],
[1, ':-1'],
],
[
['#ハッシュタグ', 6, ['#']],
[1, '#ハッシュタグ'],
],
[
['#ハッシュ タグ', 7, ['#']],
[1, '#ハッシュ タグ'],
],
] as const)(
'textAtCursorMatchesToken(%s) is %o',
([input, expected], { expect }) => {
expect(
textAtCursorMatchesToken(input[0], input[1], Array.from(input[2])),
).toStrictEqual(expected);
},
);
});