chore(web): add Vitest; add dayCapabilities helper with full test coverage

- Install vitest + jsdom
- Add test/test:watch scripts to package.json
- Add test:web and test:all tasks to mise.toml
- Add dayCapabilities() to utils.ts — single source of truth for
  what actions are permitted per day (future/today/past, open/closed)
- Add DayCapabilities interface to utils.ts
- 11 unit tests: dayCapabilities (5 cases), weekDayKeys (3 cases),
  isWorkday (3 cases)
This commit is contained in:
2026-04-30 19:03:04 +02:00
parent 73e5b01577
commit 6c4f78d101
6 changed files with 1055 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { sveltekit } from '@sveltejs/kit/vite';
import { defineConfig } from 'vite';
import { defineConfig } from 'vitest/config';
import { VitePWA } from 'vite-plugin-pwa';
export default defineConfig({
@@ -45,5 +45,10 @@ export default defineConfig({
'/api': 'http://localhost:8080',
'/healthz': 'http://localhost:8080'
}
},
test: {
environment: 'jsdom',
globals: true,
include: ['src/**/*.test.ts']
}
});