0284c9b83a
- Vitest units: board replay, placement machine, premium parity, i18n key parity, FlatBuffers codec round-trips (19 tests) - Playwright smoke (mock transport): guest -> lobby -> board -> place tile -> preview - ui-test.yaml workflow: check/unit/build + bundle-size budget (67.5KB gzip < 100KB) + chromium e2e - gateway transcode tests for games.list (seat display_name), pass, hint - backend integration test for game.ListForAccount
21 lines
711 B
TypeScript
21 lines
711 B
TypeScript
import { describe, expect, it } from 'vitest';
|
|
import { en } from './i18n/en';
|
|
import { ru } from './i18n/ru';
|
|
import { errorKey, translate } from './i18n/catalog';
|
|
|
|
describe('i18n catalog', () => {
|
|
it('has identical keys in en and ru', () => {
|
|
expect(Object.keys(ru).sort()).toEqual(Object.keys(en).sort());
|
|
});
|
|
|
|
it('interpolates parameters', () => {
|
|
expect(translate('en', 'game.bag', { n: 7 })).toBe('Bag 7');
|
|
expect(translate('ru', 'game.bag', { n: 7 })).toBe('Мешок 7');
|
|
});
|
|
|
|
it('maps error codes to keys with a generic fallback', () => {
|
|
expect(errorKey('not_your_turn')).toBe('error.not_your_turn');
|
|
expect(errorKey('totally_unknown')).toBe('error.generic');
|
|
});
|
|
});
|