Files
ashen-realms/apps/api/src/reputation/reputation-rank.spec.ts
Bastian Wagner e48409fbf1 feat(reputation): translate rank labels to English
Translates the six REPUTATION_RANKS labels in reputation-rank.ts
(Geachtet/Vertraut/Anerkannt/Bekannt/Geduldet/Fremder -> Esteemed/
Trusted/Recognized/Known/Tolerated/Stranger), per the glossary in
docs/superpowers/specs/2026-08-21-english-game-content-foundation-design.md
section 4. Keys and thresholds are unchanged.

Also updates reputation.service.spec.ts and reputation.controller.spec.ts,
which asserted the German rankLabel value returned by
resolveReputationRank() via the service/controller layer.
2026-08-21 20:08:59 +02:00

34 lines
1.2 KiB
TypeScript

import { resolveReputationRank } from './reputation-rank';
describe('resolveReputationRank', () => {
it('resolves 0 reputation to Stranger with a next threshold of 100', () => {
expect(resolveReputationRank(0)).toEqual({
key: 'STRANGER',
label: 'Stranger',
threshold: 0,
nextThreshold: 100,
});
});
it('resolves exactly at a threshold to that rank, not the one below', () => {
expect(resolveReputationRank(100).key).toBe('TOLERATED');
expect(resolveReputationRank(99).key).toBe('STRANGER');
});
it('resolves every documented threshold to its exact rank', () => {
expect(resolveReputationRank(250).key).toBe('KNOWN');
expect(resolveReputationRank(500).key).toBe('RECOGNIZED');
expect(resolveReputationRank(800).key).toBe('TRUSTED');
expect(resolveReputationRank(1200).key).toBe('ESTEEMED');
});
it('has no next threshold once at the top rank', () => {
expect(resolveReputationRank(1200).nextThreshold).toBeNull();
expect(resolveReputationRank(50_000).nextThreshold).toBeNull();
});
it('reports the correct nextThreshold mid-range', () => {
expect(resolveReputationRank(300).nextThreshold).toBe(500);
});
});