Files
Ydisks-Xianyu-Helper/frontend/chatEmojis.test.tsx
T
Christ 67d7214930 feat: add account automation and isolated chat
- add account-level auto rating and daily polish tasks\n- add cached historical chat, media, emoji, and per-account realtime sync\n- add SQLite, MySQL, and PostgreSQL migrations and regression coverage\n- align account, sidebar, and chat interfaces with the new workflows
2026-08-08 22:16:35 +08:00

23 lines
942 B
TypeScript

import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, test } from 'vitest';
import { renderXianyuText, xianyuEmojis } from './chatEmojis';
describe('official Xianyu emoji mapping', () => {
test('contains the complete official panel in official order', () => {
expect(xianyuEmojis).toHaveLength(126);
expect(xianyuEmojis[0][0]).toBe('尊嘟假嘟');
expect(xianyuEmojis.at(-1)?.[0]).toBe('爱心');
expect(new Set(xianyuEmojis.map(([name]) => name)).size).toBe(126);
});
test('uses official CDN assets and renders bracket codes inline', () => {
for (const [, url] of xianyuEmojis) {
expect(url).toMatch(/^https:\/\/img\.alicdn\.com\//);
}
const html = renderToStaticMarkup(<>{renderXianyuText('你好[捂脸哭][送花]')}</>);
expect(html).toContain('你好');
expect(html).toContain('alt="[捂脸哭]"');
expect(html).toContain('alt="[送花]"');
});
});