import { describe, expect, it } from 'vitest' import { DEFAULT_SETTINGS, GAME_STATS, SAMPLE_EXERCISES, STAT_LABELS, type GameStat } from './types' describe('DEFAULT_SETTINGS', () => { it('uses safe defaults that do not surprise the user', () => { expect(DEFAULT_SETTINGS.globalEnabled).toBe(true) expect(DEFAULT_SETTINGS.notificationMode).toBe('modal') expect(DEFAULT_SETTINGS.minimizeToTray).toBe(true) expect(DEFAULT_SETTINGS.startWithWindows).toBe(false) // never auto-enroll expect(DEFAULT_SETTINGS.snoozeMinutes).toBeGreaterThan(0) }) }) describe('SAMPLE_EXERCISES', () => { it('ships at least one enabled sample so the app is not empty on first launch', () => { expect(SAMPLE_EXERCISES.length).toBeGreaterThan(0) expect(SAMPLE_EXERCISES.some((e) => e.enabled)).toBe(true) }) it('all samples have positive reps and intervals', () => { for (const ex of SAMPLE_EXERCISES) { expect(ex.reps, `reps for ${ex.name}`).toBeGreaterThan(0) expect(ex.intervalMinutes, `interval for ${ex.name}`).toBeGreaterThan(0) expect(ex.icon.length, `icon set for ${ex.name}`).toBeGreaterThan(0) } }) }) // NB: тест «sample icons ⊆ ICON_CHOICES» лежит в // src/renderer/src/lib/icon-choices.test.ts — он тянет renderer-сторону // (ICON_CHOICES), а node-tsconfig сюда не пускает renderer-импорты. describe('STAT_LABELS', () => { it('has a Russian label for every GameStat in every GAME_STATS bundle', () => { for (const stats of Object.values(GAME_STATS)) { for (const stat of stats as readonly GameStat[]) { expect(STAT_LABELS[stat], `label for ${stat}`).toBeTruthy() } } }) })