b15fd30c4f
CI / changes (pull_request) Successful in 1s
CI / unit (pull_request) Successful in 8s
CI / integration (pull_request) Successful in 12s
CI / ui (pull_request) Successful in 27s
CI / gate (pull_request) Successful in 0s
CI / deploy (pull_request) Successful in 1m6s
- #4 bag label: '{n} in the bag' / 'Bag is empty' (was 'Bag {n}') - #6 allow a single trailing dot in display names (backend + UI regex + tests) - #1 double-tap zooms toward the tapped cell, not the top-left - #8 shuffle fires a short multi-pulse haptic - #11 highlighted/flashing tiles darken their bottom edge too (shadow joins the flash) - #13 toast slides up from the bottom and fades out - #7 hide the logout button (kept wired behind `hidden`) - #16 admin game seats: left-align numeric columns, clarify the 'Hints used' header
21 lines
721 B
TypeScript
21 lines
721 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('7 in the bag');
|
|
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');
|
|
});
|
|
});
|