Files
MyGoNavi/frontend/src/App.tools-entry.i18n.test.ts
tianqijiuyun-latiao 9364c48ef0 feat(i18n): 完善多模块多语言适配与发版验证
扩展前后端多语言文案与共享词典。增加多模块 i18n 回归测试与 guard。收口外部 SQL 菜单和弹窗多语言文案。
2026-06-17 13:17:33 +08:00

23 lines
1.0 KiB
TypeScript

import { describe, expect, it } from 'vitest';
import { readFileSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
const appSource = readFileSync(
fileURLToPath(new globalThis.URL('./App.tsx', import.meta.url)),
'utf8',
);
describe('App tools entry i18n guards', () => {
it('localizes compare tool entry titles and descriptions', () => {
expect(appSource).toContain("t('app.tools.entry.schema_compare.title')");
expect(appSource).toContain("t('app.tools.entry.schema_compare.description')");
expect(appSource).toContain("t('app.tools.entry.data_compare.title')");
expect(appSource).toContain("t('app.tools.entry.data_compare.description')");
expect(appSource).not.toContain("title: '表结构比对'");
expect(appSource).not.toContain("description: '对比源表与目标表结构差异,只预览不执行。'");
expect(appSource).not.toContain("title: '数据比对'");
expect(appSource).not.toContain("description: '按主键分析新增、更新、删除和相同行。'");
});
});