Don't auto-default initialRouteEntries from mountPath — for
parameterized paths this silently produces wrong params (literal
':name' values). Require callers to set both explicitly.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
- Remove the path="*" fallback Route so mismatches between mountPath
and initialRouteEntries surface as test failures instead of silently
rendering without params
- Handle mountPath values that already end with /* to avoid double splat
- Extract repeated entity path string into a shared constant
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Address review feedback: mountedRoutes are for abstract route targets
the test subject links to, not for the subject itself. Add a dedicated
mountPath option that wraps the test element in a single Route with
the given path pattern, enabling useParams(). When mountPath is set
and initialRouteEntries is not, the initial entry defaults to mountPath.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Now that renderInTestApp properly sets up Route matching, the test can
use the real in-memory catalog client instead of jest stubs. The
in-memory client does actual ref-based lookups, verifying that
useEntityFromUrl receives correct route params end-to-end.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
renderInTestApp disables app/routes, so the test element was rendered
without any Route matching. This meant useParams() always returned {}
even when initialRouteEntries and mountedRoutes were set — the mounted
routes only fed the route resolution API for link generation, never
created actual React Router <Route> matching for param extraction.
Wrap the test element in <Routes> with a <Route> for each mounted path
(plus a path="*" fallback), mirroring what the real AppRoutes extension
does via useRoutes(). This makes useParams() return real params when
initialRouteEntries matches a mounted route path.
Update entity page test href expectations to match the now-correct
production behavior where sub-route links resolve relative to the
matched parent Route, and replace synchronous getByTestId/getByText
with async findBy queries for lazy-loaded content.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
The entity page resolves route params via useRouteRefParams. Without
initialRouteEntries, the MemoryRouter starts at '/' which doesn't
match the entity route pattern. On fast machines the mock entity
resolves before the useEffect error check fires, but on slow CI
runners the timing differs and the "No name provided!" error path
wins, causing the test to flake.
Adding initialRouteEntries ensures the router starts at a URL that
matches /catalog/:namespace/:kind/:name, so route params are always
available regardless of timing.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
The InMemoryCatalogClient + initialRouteEntries approach didn't work
because route params weren't being resolved by the test harness,
causing getEntityByRef to receive an empty ref. The original mock
with getEntityByRef: async () => entityMock works correctly. The
only change from master is adding the Entity type annotation.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
The test rendered at '/' instead of a URL matching the entity route
pattern, causing useEntityFromUrl to sometimes fail to extract route
params. Use initialRouteEntries to start at the correct entity URL,
and switch from catalogApiMock.mock() to catalogApiMock() for a
working in-memory catalog client.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
The env vars used lowercase postgres18/postgres14 instead of uppercase
POSTGRES18/POSTGRES14, which didn't match the names expected by
TestDatabases. This caused all postgres-only test suites to see no
available databases and crash.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
When eachSupportedId() returned an empty array, describe.each([]) would
throw and crash the entire test suite. Return a placeholder ID instead,
so individual tests fail with a clear error rather than preventing the
entire suite from running.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This change aligns the MCP tool execution responses with the specification by returning plain text in the 'content' array and providing the raw JSON in a new 'structuredContent' field. It also removes the unnecessary Markdown code block formatting that was previously added to tool results.
Fixes#34052
Signed-off-by: Love Kumar Chauhan <lovechauhan6564@gmail.com>
Co-authored-by: benjdlambert <3645856+benjdlambert@users.noreply.github.com>
Signed-off-by: benjdlambert <ben@blam.sh>
We should mostly get these for free because of the
GitHub conditional request caching, but this is a
nice safety net and also probably saves us some
time.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
Keeping this change as minimal as possible for
this first phase, will restore the parallel
processing in a later iteration.
Signed-off-by: MT Lewis <mtlewis@users.noreply.github.com>
Only delete the cache entry on error if the map still holds the same
promise, preventing a stale rejection from evicting a newer entry.
Also switch the test to createDeferred for readability.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
Moves the mcp-server specType registration out of the default catalog
entity model into a separate backend module following the same pattern
as the AiResource module. Types and validators are now alpha exports.
Signed-off-by: benjdlambert <ben@blam.sh>
Registers mcp-server as a specType on v1alpha1/v1beta1 instead of
introducing a new v1alpha2 apiVersion. Adds addKindVersion to the
builder so separate layers can extend existing kinds.
Signed-off-by: benjdlambert <ben@blam.sh>
Adds addKindVersion to CatalogModelLayerBuilder so layers can add
versions to an existing kind without re-declaring its metadata.
Moves v1alpha2 API registration into ApiEntityV1alpha2.ts as a
separate model layer using the new method.
Signed-off-by: benjdlambert <ben@blam.sh>