zunda 449aa77337 [Glitch] Accept non-Latin characters to suggest hash tag
Port 72085f7d5288692f85e411916d3f0f18a3603574 to glitch-soc

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

30 lines
671 B
TypeScript

import { textAtCursorMatchesToken } from './utils';
describe('textAtCursorMatchesToken', () => {
test.concurrent.for([
[
['#hashtag', 7, ['#']],
[1, '#hashtag'],
],
[
['#hash tag', 8, ['#']],
[1, '#hash tag'],
],
[
['#ハッシュタグ', 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);
},
);
});