5180 fichiers 38.5 Mo 0 téléchargements 185 vues mis à jour il y a 5 heures ui
nitro-v36-with-renderer-v36 / src / api / utils / localizeServerText.test.ts
localizeServerText.test.ts 849 o Télécharger le fichier
import { describe, expect, it } from 'vitest';
import { localizeServerText, titleFromKey } from './localizeWithFallback';

describe('titleFromKey', () => {
    it('reads the last part of a key as a title', () => {
        expect(titleFromKey('navigator.flatcategory.global.TRADING')).toBe('Trading');
        expect(titleFromKey('navigator.flatcategory.global.ROLE_PLAY')).toBe('Role play');
    });
});

describe('localizeServerText', () => {
    it('never shows a ${key} as typed', () => {
        // the test localization has no such key: the readable fallback is used
        expect(localizeServerText('${navigator.flatcategory.global.GAMES}')).toBe('Games');
    });

    it('keeps plain text as it is', () => {
        expect(localizeServerText('Mijn kamers')).toBe('Mijn kamers');
        expect(localizeServerText('')).toBe('');
    });
});
15Sujets
1Dépôts
20Membres
2En ligne
Profile
Inscrit
Dernière visite
Messages
0
Votes positifs
0
Votes négatifs
0

Nous utilisons des cookies pour assurer le bon fonctionnement du site et améliorer votre expérience. en savoir plus

Autoriser