Skip to content

test: add ~134 tests for application services, gateway, and frontend - #135

Open
its-mash wants to merge 5 commits into
mainfrom
test/comprehensive-test-coverage
Open

test: add ~134 tests for application services, gateway, and frontend#135
its-mash wants to merge 5 commits into
mainfrom
test/comprehensive-test-coverage

Conversation

@its-mash

Copy link
Copy Markdown
Member

Summary

  • Add 44 Rust integration tests for core application services (ServerAppService, SpaceAppService, ClientAppService, PermissionAppService) — these had zero test coverage
  • Add 27 Rust unit tests for gateway internals (GatewayState, RateLimiter, routing auth error detection) as inline #[cfg(test)] modules
  • Add 11 Rust integration tests for gateway services (AuthorizationService, SpaceResolverService) using real SQLite + mock repos
  • Add 49 TypeScript tests for pure functions (getConnectButtonLabel, getServerAction), Zustand selectors (useActiveSpace, useViewSpace, useIsLoading), and React hooks (useDomainEvents, useSpaces, useServerManager)
  • Add 3 Rust unit tests for EventBus edge cases (try_recv, emit_or_warn)

Test plan

  • cargo test --workspace --lib — all Rust unit tests pass
  • cargo test -p tests — all Rust integration tests pass
  • pnpm test:ts — all 212 TypeScript tests pass (49 new)
  • cargo clippy --workspace -- -D warnings — zero warnings
  • pnpm validate — fmt, clippy, eslint, typecheck all pass

…uninstall confirm

- Headers from server definitions are now always applied as default_headers
  on the reqwest::Client regardless of auth strategy (OAuth, PAT, or no-auth)
- If headers contain an Authorization header, OAuth is skipped entirely
- If headers have no Authorization, they ride alongside OAuth tokens
- Add build_default_headers() and build_http_client() helpers
- Remove standalone connect_with_headers() in favor of orthogonal design
- Add 19 unit tests for HttpTransport (requires_oauth, header building,
  connect routing logic, transport_type, description)
- Remove broken confirm() dialog from server uninstall action

Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
Cover critical gaps identified in test coverage analysis:
- Application services (ServerAppService, SpaceAppService, ClientAppService,
  PermissionAppService) had zero test coverage — now 44 integration tests
- Gateway unit tests for GatewayState, RateLimiter, and routing auth error
  detection — 27 inline tests
- Gateway integration tests for AuthorizationService and SpaceResolverService
  — 11 tests with real SQLite repos
- TypeScript tests for pure functions (getConnectButtonLabel, getServerAction),
  Zustand selectors, and React hooks (useDomainEvents, useSpaces,
  useServerManager) — 49 tests
- EventBus edge cases (try_recv, emit_or_warn) — 3 tests

Signed-off-by: Myko <myko@mcpmux.com>
Signed-off-by: Mohammod Al Amin Ashik <maa.ashik00@gmail.com>
it('null spaceId skips fetch', async () => {
mockListen.mockResolvedValue(vi.fn());

const { result } = renderHook(() =>
@its-mash
its-mash force-pushed the main branch 2 times, most recently from 04e4d51 to 9e481e7 Compare July 15, 2026 01:36
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