Statistikportal für den All-the-Mods-10-Server (Minecraft 1.21.1, NeoForge 21.1): - mod/: serverseitige NeoForge-Mod atmstats – Ereignisse, Live-Zähler, Servergesundheit, FTB-Dateien; Outbox auf der Festplatte, signierter gzip-Versand per HTTPS mit Backoff - backend/: Fastify + PostgreSQL – idempotenter Ingest, Projektionen, Parser für SNBT, FTB Quests/Teams, world/stats, world/advancements und latest.log; Ranglisten, Snapshots, Retention, öffentliche API, SSE-Live-Updates, Admin mit argon2/CSRF, SFTP-Worker - web/: Next.js-Dashboard – Übersicht, Ranglisten, Spielerprofile, ATM10, Server, Datenquellen, Verwaltung - shared/: Protokoll v1 und API-Typen; tools/: Simulator, Log-Anonymisierer, RCON-Client - deploy/: Docker Compose hinter Traefik, Backup; docs/: Architektur, Datenquellen, Betrieb Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
23 lines
1021 B
TypeScript
23 lines
1021 B
TypeScript
import { render, screen } from '@testing-library/react';
|
|
import { describe, expect, it } from 'vitest';
|
|
import { ActivityHeatmap } from '@/components/ActivityHeatmap';
|
|
|
|
describe('ActivityHeatmap', () => {
|
|
it('renders 168 cells with aria labels', () => {
|
|
const grid = Array.from({ length: 7 }, () => Array.from({ length: 24 }, () => 0));
|
|
grid[0]![20] = 45;
|
|
grid[6]![9] = 5;
|
|
render(<ActivityHeatmap grid={grid} />);
|
|
const cells = screen.getAllByRole('img');
|
|
expect(cells).toHaveLength(168);
|
|
expect(screen.getByRole('img', { name: 'Montag, 20 Uhr: 45 Minuten' })).toBeInTheDocument();
|
|
expect(screen.getByRole('img', { name: 'Sonntag, 9 Uhr: 5 Minuten' })).toBeInTheDocument();
|
|
});
|
|
|
|
it('shows an empty note when there is no activity', () => {
|
|
const grid = Array.from({ length: 7 }, () => Array.from({ length: 24 }, () => 0));
|
|
render(<ActivityHeatmap grid={grid} />);
|
|
expect(screen.getByText('In den letzten 90 Tagen keine Sitzungen erfasst.')).toBeInTheDocument();
|
|
});
|
|
});
|