website refactor

This commit is contained in:
2026-01-17 18:28:10 +01:00
parent 6d57f8b1ce
commit 64d9e7fd16
44 changed files with 1729 additions and 415 deletions

View File

@@ -306,4 +306,34 @@ describe('Website DI Container Integration', () => {
expect(typeof config2).toBe('function');
});
});
});
describe('SSR Boot Safety', () => {
it('resolves all tokens required for SSR entry rendering', () => {
process.env.API_BASE_URL = 'http://localhost:3001';
const container = createContainer();
// Tokens typically used in SSR (middleware, layouts, initial page loads)
const ssrTokens = [
LOGGER_TOKEN,
CONFIG_TOKEN,
SESSION_SERVICE_TOKEN,
AUTH_SERVICE_TOKEN,
LEAGUE_SERVICE_TOKEN,
DRIVER_SERVICE_TOKEN,
DASHBOARD_SERVICE_TOKEN,
// API clients are often resolved by services
AUTH_API_CLIENT_TOKEN,
LEAGUE_API_CLIENT_TOKEN,
];
for (const token of ssrTokens) {
try {
const service = container.get(token);
expect(service, `Failed to resolve ${token.toString()}`).toBeDefined();
} catch (error) {
throw new Error(`SSR Boot Safety Failure: Could not resolve ${token.toString()}. Error: ${error.message}`);
}
}
});
});
});