Skip to content

Comments

test: add unit tests for gateway functionality#415

Open
aidandaly24 wants to merge 4 commits intoaws:feat/gateway-integrationfrom
aidandaly24:feat/batch-3-unit-tests
Open

test: add unit tests for gateway functionality#415
aidandaly24 wants to merge 4 commits intoaws:feat/gateway-integrationfrom
aidandaly24:feat/batch-3-unit-tests

Conversation

@aidandaly24
Copy link
Contributor

Description

Add comprehensive unit test coverage for all MCP Gateway Phase 1 functionality introduced in Batches 1-3 (Tasks 1-9).

86 new test cases across 17 files covering:

  • Schema validation: gateway targets, outbound auth, credential discriminated union, deployed state
  • OAuth credential provider: full CRUD operations, conflict→update fallback, error paths
  • Pre-deploy identity: OAuth setup, credential collection, env var mapping
  • CLI validation: existing-endpoint path, credential validation
  • Deploy outputs: buildDeployedState with credentials, parseGatewayOutputs
  • External target creation: gateway assignment, unassigned targets, duplicate prevention, outboundAuth
  • Gateway target removal: listing, preview, removal operations
  • Preflight: gateway-only deploy validation
  • Credential references: cross-gateway warning on removal
  • Add command actions: buildGatewayTargetConfig mapping
  • UI: AddScreen/RemoveScreen enablement, ResourceGraph unassigned targets
  • Types: constants validation (AUTHORIZER_TYPE_OPTIONS, SKIP_FOR_NOW, SOURCE_OPTIONS)

New test files:

  • oauth2-credential-provider.test.ts
  • remove-gateway-target.test.ts (operations)
  • remove-identity.test.ts
  • actions.test.ts (add command)
  • AddScreen.test.tsx
  • RemoveScreen.test.tsx
  • types.test.ts (mcp)

Extended test files:

  • mcp.test.ts, agentcore-project.test.ts, deployed-state.test.ts (schemas)
  • validate.test.ts, outputs.test.ts, pre-deploy-identity.test.ts, preflight.test.ts
  • ResourceGraph.test.tsx, create-mcp.test.ts

Related Issue

Part of the MCP Gateway Phase 1 integration (gateway-integration branch). Task 9c Part 1.

Type of Change

  • Other (please describe): Unit test coverage for existing functionality

Testing

How have you tested the change?

  • I ran npm run test:unit and npm run test:integ
  • I ran npm run typecheck
  • I ran npm run lint
  • If I modified src/assets/, I ran npm run test:update-snapshots and committed the updated snapshots

All 1821 tests pass (86 new). Only source change is exporting buildGatewayTargetConfig to enable direct testing.

Checklist

  • I have read the CONTRIBUTING document
  • I have added any necessary tests that prove my fix is effective or my feature works
  • I have updated the documentation accordingly
  • I have added an appropriate example to the documentation to outline the feature, or no new docs are needed
  • My changes generate no new warnings
  • Any dependent changes have been merged and published

All gateway targets are now behind-gateway only. The mcp-runtime
exposure mode was disabled and never used by customers.

- Remove ExposureMode type, EXPOSURE_MODE_OPTIONS, --exposure and --agents CLI flags
- Simplify wizard flow: name → source → language → gateway → host → confirm
- Remove mcp-runtime code paths from create-mcp, remove-gateway-target, McpGuidedEditor
- Remove existingAgents prop chain (only used for mcp-runtime agent selection)
- Clean up unused imports (ViewMode, AgentCoreMcpRuntimeTool, WizardMultiSelect)
- Remove mcp-runtime validation tests and fixtures
- Remove mcp-runtime integration tests (add and remove)
- Simplify gateway target test fixtures to behind-gateway only
@github-actions github-actions bot added the size/xl PR size: XL label Feb 24, 2026
Comprehensive test coverage for MCP Gateway Phase 1 Batches 1-3:

- Schema validation: gateway targets, outbound auth, credentials, deployed state
- OAuth credential provider: CRUD operations, conflict handling, error paths
- Pre-deploy identity: OAuth setup, credential collection, env var mapping
- CLI validation: existing-endpoint path, credential validation
- Deploy outputs: buildDeployedState with credentials, parseGatewayOutputs
- External target creation: assignment, unassigned, duplicates, outboundAuth
- Gateway target removal: listing, preview, removal operations
- Preflight: gateway-only deploy validation
- Credential references: cross-gateway warning on removal
- Add command actions: buildGatewayTargetConfig mapping
- UI: AddScreen/RemoveScreen enablement, ResourceGraph unassigned targets
- Types: constants validation (AUTHORIZER_TYPE_OPTIONS, SKIP_FOR_NOW, SOURCE_OPTIONS)

Adds 86 new test cases across 17 files.
@aidandaly24 aidandaly24 force-pushed the feat/batch-3-unit-tests branch from 89047e9 to aaba408 Compare February 24, 2026 02:52
@github-actions github-actions bot added size/xl PR size: XL and removed size/xl PR size: XL labels Feb 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size/xl PR size: XL

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant