feat(library): add the game data correction dialog
Build, Test & Push Frontend / quality-check (push) Successful in 17s
Build, Test & Push Frontend / docker (push) Successful in 25s

This commit is contained in:
lobo committed 2026-09-28 09:31:39 +02:00
1 parent afe00ceae9
commit 6601277961
9 files changed
+434 -3

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
import {describe, expect, it} from 'vitest';
import en from '../../public/i18n/en.json';
import de from '../../public/i18n/de.json';
import {canCorrect, IGDB_GENRES} from './corrections.js';
import {genreKey} from './stats.js';
describe('corrections', () => {
it('knows a text for every IGDB genre it offers', () => {
for (const genre of IGDB_GENRES) {
expect(en.STATS.GENRE[genreKey(genre)], genre).toBeTruthy();
expect(de.STATS.GENRE[genreKey(genre)], genre).toBeTruthy();
}
});
it('lets only an active AUDITOR or higher correct', () => {
expect(canCorrect({role: 'AUDITOR', activeRole: 'AUDITOR'})).toBe(true);
expect(canCorrect({role: 'PLATFORM_ADMIN', activeRole: 'PLATFORM_ADMIN'})).toBe(true);
expect(canCorrect({role: 'PLATFORM_ADMIN', activeRole: 'USER'})).toBe(false);
expect(canCorrect({role: 'USER', activeRole: 'USER'})).toBe(false);
expect(canCorrect(null)).toBe(false);
});
});