test: extend test coverage for backend and frontend #2

Merged
vikingowl merged 1 commits from feature/test-coverage into dev 2026-01-22 11:09:43 +01:00
Owner

Summary

Comprehensive test coverage for backend and frontend, increasing total tests from ~61 to ~547.

Test Summary

Type Before After
Backend tests 0 ~50
Frontend unit tests 61 469
E2E tests 0 28
Total ~61 ~547

Backend Coverage

  • fetcher_test.go - HTML stripping, URL utilities
  • model_registry_test.go - Parsing, size ranges, model matching
  • database_test.go - CRUD operations, migrations
  • geolocation_test.go, search_test.go, tools_test.go, version_test.go

Frontend Unit Tests

  • OllamaClient: 22 tests with mocked fetch
  • Memory/RAG: tokenizer, chunker, summarizer, embeddings, vector-store
  • Services: prompt-resolution, conversation-summary
  • Components: Skeleton, BranchNavigator, ConfirmDialog, ThinkingBlock
  • Utils: export, import, file-processor
  • Tools: builtin math parser (44 tests)

E2E Tests (Playwright)

  • App loading, sidebar navigation, settings page
  • Chat interface, responsive design, accessibility
  • Modal interactions (import dialog, project modal)

Closes #8

Test plan

  • cd backend && go test ./... - all pass
  • cd frontend && npm test - 469 tests pass
  • cd frontend && npm run test:e2e - 28 tests pass
## Summary Comprehensive test coverage for backend and frontend, increasing total tests from ~61 to ~547. ## Test Summary | Type | Before | After | |------|--------|-------| | Backend tests | 0 | ~50 | | Frontend unit tests | 61 | 469 | | E2E tests | 0 | 28 | | **Total** | **~61** | **~547** | ## Backend Coverage - `fetcher_test.go` - HTML stripping, URL utilities - `model_registry_test.go` - Parsing, size ranges, model matching - `database_test.go` - CRUD operations, migrations - `geolocation_test.go`, `search_test.go`, `tools_test.go`, `version_test.go` ## Frontend Unit Tests - **OllamaClient**: 22 tests with mocked fetch - **Memory/RAG**: tokenizer, chunker, summarizer, embeddings, vector-store - **Services**: prompt-resolution, conversation-summary - **Components**: Skeleton, BranchNavigator, ConfirmDialog, ThinkingBlock - **Utils**: export, import, file-processor - **Tools**: builtin math parser (44 tests) ## E2E Tests (Playwright) - App loading, sidebar navigation, settings page - Chat interface, responsive design, accessibility - Modal interactions (import dialog, project modal) ## Related Issue Closes #8 ## Test plan - [x] `cd backend && go test ./...` - all pass - [x] `cd frontend && npm test` - 469 tests pass - [x] `cd frontend && npm run test:e2e` - 28 tests pass
vikingowl added 1 commit 2026-01-22 11:08:07 +01:00
Backend:
- Add fetcher_test.go (HTML stripping, URL fetching utilities)
- Add model_registry_test.go (parsing, size ranges, model matching)
- Add database_test.go (CRUD operations, migrations)
- Add tests for geolocation, search, tools, version handlers

Frontend unit tests (469 total):
- OllamaClient: 22 tests for API methods with mocked fetch
- Memory/RAG: tokenizer, chunker, summarizer, embeddings, vector-store
- Services: prompt-resolution, conversation-summary
- Components: Skeleton, BranchNavigator, ConfirmDialog, ThinkingBlock
- Utils: export, import, file-processor, keyboard
- Tools: builtin math parser (44 tests)

E2E tests (28 total):
- Set up Playwright with Chromium
- App loading, sidebar navigation, settings page
- Chat interface, responsive design, accessibility
- Import dialog, project modal interactions

Config changes:
- Add browser conditions to vitest.config.ts for Svelte 5 components
- Add playwright.config.ts for E2E testing
- Add test:e2e scripts to package.json
- Update .gitignore to exclude test artifacts

Closes #8
vikingowl merged commit e091a6c1d5 into dev 2026-01-22 11:09:43 +01:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: vikingowl/vessel#2