Session 12: i18n (10 languages, cookie-based), Africa tier .99, locale switcher, RTL Arabic (1305 tests)

This commit is contained in:
Kev
2026-06-10 22:24:40 -04:00
parent e5c45ecc8e
commit d957dee17b
27 changed files with 1834 additions and 29 deletions
+33 -2
View File
@@ -1,8 +1,39 @@
const { TIERS, VALID_TIERS, getTier, getScanLimit, canAccess } = require('../../src/config/tiers');
describe('tiers config', () => {
test('VALID_TIERS includes free, analyst, desk', () => {
expect(VALID_TIERS).toEqual(['free', 'analyst', 'desk']);
test('VALID_TIERS includes free, africa, analyst, desk (Session 12 added africa)', () => {
expect(VALID_TIERS).toEqual(['free', 'africa', 'analyst', 'desk']);
});
describe('africa tier (Session 12)', () => {
test('exists with 10 scans/day, reasoning + kill conditions visible', () => {
const a = TIERS.africa;
expect(a).toBeDefined();
expect(a.scans_per_day).toBe(10);
expect(a.reasoning_visible).toBe(true);
expect(a.kill_conditions_detail).toBe(true);
// alerts + portfolio + engine2 are paid-tier extras — Africa
// does not include them.
expect(a.alerts).toBe(false);
expect(a.portfolio).toBe(false);
expect(a.engine2).toBe(false);
});
test('api_access is FALSE on africa tier (immutable)', () => {
expect(TIERS.africa.api_access).toBe(false);
});
test('africa scans_per_day sits between free (3) and analyst (15)', () => {
expect(TIERS.africa.scans_per_day).toBeGreaterThan(TIERS.free.scans_per_day);
expect(TIERS.africa.scans_per_day).toBeLessThan(TIERS.analyst.scans_per_day);
});
test('getScanLimit resolves "africa" correctly (sanity for the scan-limit middleware)', () => {
expect(getScanLimit('africa')).toBe(10);
});
test('canAccess("africa", "reasoning_visible") is true', () => {
expect(canAccess('africa', 'reasoning_visible')).toBe(true);
expect(canAccess('africa', 'kill_conditions_detail')).toBe(true);
expect(canAccess('africa', 'alerts')).toBe(false);
expect(canAccess('africa', 'api_access')).toBe(false);
});
});
test('api_access is FALSE on every tier (non-negotiable)', () => {