Testing
The test strategy should keep persistence, sync, mapping, and validation logic
covered without depending on live provider services.
Expected Checks
Once the app scaffold exists, run available checks before finishing each
implementation step:
pnpm typecheck
pnpm lint
pnpm test
pnpm build
If a command is unavailable, explain why in the final response for that step.
Unit Tests
Add unit tests for:
- DTO and provider mappers.
- IPC input validation.
- Date/time helpers.
- Recurrence expansion.
- Sync state transitions.
- Conflict handling.
- Provider payload creation.
Integration Tests
Add integration tests for:
- SQLite migrations.
- Repository CRUD behavior.
- Foreign key behavior and cascading deletes.
- Default local account/calendar creation.
- Event range queries.
Tests should use temporary or in-memory databases. They must not touch a real
user database.
Provider Tests
Provider adapters must be mockable.
- Google tests must mock Google Calendar API calls.
- Microsoft tests must mock Microsoft Graph calls.
- CalDAV tests must mock CalDAV/WebDAV clients.
- No real provider API calls are allowed in automated tests.
- Test fixtures must not contain real tokens, refresh tokens, auth codes, client
secrets, or private user data.
Electron UI Smoke Tests
Manual smoke tests are acceptable early for Electron UI behavior. Expected smoke
coverage includes:
- App launches.
- Renderer displays the calendar shell.
- Local calendars load.
- Local event create/edit/delete works.
- Drag/drop and resize persist once implemented.
- Restarting the app preserves local data.
End-to-end tests with Playwright or another suitable tool can be added later
where they provide enough value to justify the maintenance cost.