Skip to content

tests: P0 block (chat, session, signed links, settings)#29

Merged
Endorpheen merged 2 commits intomainfrom
feat/tests-block1-2025-11-03
Nov 4, 2025
Merged

tests: P0 block (chat, session, signed links, settings)#29
Endorpheen merged 2 commits intomainfrom
feat/tests-block1-2025-11-03

Conversation

@Endorpheen
Copy link
Copy Markdown
Owner

What's covered

Backend (67 tests, 57% coverage)

  • Integration tests: test_chat_service.py - 3 tests
    • OpenRouter API key override functionality
    • AgentRouter provider arguments passing
    • Tool failure handling with API_ERROR_GENERATING_RESPONSE marker
  • Unit tests: test_session_manager.py - 29 tests (89% module coverage)
    • Token issuance and verification
    • Expiration handling and invalid signature detection
    • Legacy session compatibility and origin validation
  • Unit tests: test_signed_links.py - 20 tests (97% module coverage)
    • Signed link generation and validation
    • Expiration, malformed input, and signature error handling

Frontend (19 tests)

  • Unit tests: agentRouterFallback.test.ts - 16 tests
    • Fallback logic for 400/404 API errors
    • Switching between text input and select dropdown
    • Model value update logic
  • Unit tests: session.test.ts - 3 tests (existing)

Infrastructure

  • Configured local UV cache for stable test runs
  • Added testing dependencies (@testing-library/*, jsdom)
  • Created separate runner for DOM tests

Test commands

npm run test:backend
cd web-ui && npm run test
cd web-ui && npm run test:dom

All tests passing without production code changes.

🤖 Generated with Claude Code

end0 and others added 2 commits November 3, 2025 23:38
Backend improvements:
- Add comprehensive integration tests for chat service (test_chat_service.py)
  - OpenRouter API key override functionality
  - AgentRouter provider arguments passing
  - Tool failure handling with API_ERROR_GENERATING_RESPONSE marker
- Add unit tests for Session manager (test_session_manager.py)
  - Token issuance, verification, expiration handling
  - Legacy session compatibility and origin validation
  - 29 test cases with edge cases and error conditions
- Add unit tests for Signed links (test_signed_links.py)
  - Link generation, validation, signature verification
  - URL encoding, expiration, and malformed input handling
  - 20 test cases covering all failure modes

Frontend improvements:
- Add AgentRouter fallback logic tests (agentRouterFallback.test.ts)
  - 16 unit tests for 400/404 fallback behavior
  - Model input type switching logic
  - API response handling and provider switching
- Add dedicated test runner for DOM tests (scripts/run-dom-tests.mjs)
- Install testing dependencies (@testing-library/*, jsdom)

Infrastructure:
- Configure local UV cache (.cache/uv) for consistent test runs
- Fix test compatibility issues with proper mocking
- Update TEST_GAPS.md with completed P0 scenarios
- Improve backend coverage from 50% to 57%

All tests passing:
- Backend: 67 tests passing, 57% coverage
- Frontend: 19 tests passing across unit and DOM suites

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
@Endorpheen Endorpheen merged commit e6ac1ed into main Nov 4, 2025
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant