Skip to content

test: MCP handlers, channel server, and dashboard store schedule tests - #140

Merged
aterrylu merged 1 commit into
mainfrom
terry/scheduler-mcp-tests
Apr 14, 2026
Merged

test: MCP handlers, channel server, and dashboard store schedule tests#140
aterrylu merged 1 commit into
mainfrom
terry/scheduler-mcp-tests

Conversation

@aterrylu

Copy link
Copy Markdown
Owner

Summary

  • Add 42 tests covering all remaining scheduler test gaps
  • Closes the MCP handler, channel server routing, and dashboard store coverage holes
  • Export _createMcpServerForTesting from mcp.ts for InMemoryTransport testing

New Test Coverage

File Tests What's Verified
mcp-schedules.test.ts 14 All 6 MCP tool handlers via real MCP SDK Client + InMemoryTransport
channel-schedules.test.ts 11 Channel server URL construction, arg passthrough, encodeURIComponent
store-schedules.test.ts 17 All 6 Zustand store methods: fetch, delete, run, update, status, settings

Total Scheduler Test Coverage (across all PRs)

PR Tests Layer
#137 96 CRUD, engine dispatch, REST API
#139 16 Executor code paths (spawn args, routing, onComplete)
This PR 42 MCP handlers, channel server, dashboard store
Total 154 Full stack coverage

Test plan

  • 222 server tests pass (all existing + new)
  • 17 dashboard schedule store tests pass
  • TypeScript clean
  • Biome clean
  • 2 pre-existing dashboard test failures (store.test.ts layout logic) — not related

🤖 Generated with Claude Code

…tests

Add 42 tests covering the remaining scheduler test gaps:

MCP HTTP handlers (14 tests via InMemoryTransport):
- All 6 schedule tools: create, list, get, update, delete, run
- Error cases: duplicate name, invalid name, not found
- Full lifecycle test: create → list → get → update → run → delete

Channel server routing (11 tests):
- All 6 tool-to-REST-API URL mappings verified
- Argument passthrough and encodeURIComponent
- Error propagation from REST API
- Full lifecycle integration test

Dashboard store methods (17 tests via vitest):
- fetchSchedules: loading state, success, server error, network error
- deleteSchedule: store removal, error handling, URL encoding
- runSchedule: correct URL, error handling
- updateSchedule: store update, JSON body, error handling
- fetchSchedulerStatus: success, silent error handling
- updateSchedulerSettings: store update, correct body, error handling

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@aterrylu
aterrylu merged commit 140b4c8 into main Apr 14, 2026
1 check passed
@aterrylu
aterrylu deleted the terry/scheduler-mcp-tests branch April 14, 2026 10:28
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