298 Commits

Author SHA1 Message Date
github-actions[bot] 68db890456 Version Packages (next) 2026-05-26 15:26:38 +00:00
Fredrik Adelöw 7efdc27464 Remove mountPath → initialRouteEntries defaulting
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>
2026-05-25 15:18:11 +02:00
Fredrik Adelöw fcde31d871 Address review: remove fallback route, handle trailing splat, extract shared path
- 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>
2026-05-21 15:49:36 +02:00
Fredrik Adelöw bc1b4263c9 Update API report for frontend-test-utils
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-21 15:40:39 +02:00
Fredrik Adelöw 5dca781385 Replace mountedRoutes-based wrapping with mountPath option
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>
2026-05-21 13:39:52 +02:00
Fredrik Adelöw 62dd4fc3bc Add changeset for renderInTestApp route matching fix
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-05-20 10:31:13 +02:00
Fredrik Adelöw a06003bc90 Switch to in-memory catalog client for entity page tests
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>
2026-05-20 10:28:18 +02:00
Fredrik Adelöw 95e107bc6e Wrap test element in Routes when mountedRoutes are provided
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>
2026-05-20 09:42:47 +02:00
github-actions[bot] b97fcb0a93 Version Packages 2026-05-19 18:28:24 +00:00
Patrik Oldsberg 269c4f9f0d Remove legacy nav stub from renderInTestApp
Disable app/nav in the minimal test shell instead of rendering
legacy nav-item extensions. Use renderTestApp when nav behavior matters.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 11:15:31 +02:00
Patrik Oldsberg 10e5d6f8aa Remove NavItemBlueprint in favor of page-based nav discovery
Drop the deprecated NavItemBlueprint from the public API and migrate core
plugins to set title and icon on PageBlueprint instead. AppNav keeps
backward compatibility for legacy nav-item extensions via an internal
core.nav-item.target data ref.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-19 11:00:46 +02:00
github-actions[bot] 7295193bb6 Version Packages (next) 2026-04-28 15:53:09 +00:00
Dylan O'Gara c0f4540146 Remove type name from JSDoc comments
Signed-off-by: Dylan O'Gara <dogara@webstaurantstore.com>
2026-04-27 14:30:38 -04:00
Dylan O'Gara fa363f9d3c Add support for external refs renderInTestApp
Signed-off-by: Dylan O'Gara <dogara@webstaurantstore.com>
2026-04-27 14:06:08 -04:00
github-actions[bot] 1cc86bee1c Version Packages (next) 2026-04-21 15:07:43 +00:00
Patrik Oldsberg 0c298f7cf1 Remove internal mockWithApiFactory in favor of attachMockApiFactory
Rather than having the public attachMockApiFactory delegate to an internal
mockWithApiFactory helper, move the implementation directly into
attachMockApiFactory and use it everywhere.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-04-17 10:23:14 +02:00
Fredrik Adelöw 8e7f7249e7 chore: regenerate knip reports
Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-16 12:14:47 +02:00
Fredrik Adelöw 9279ea8366 frontend-test-utils: fix implicit any types for TypeScript 6 compatibility
Add explicit type annotations to `.map()` callback parameters in
`renderInTestApp` to prevent TS7006 errors with TypeScript 6, and
update `@mswjs/interceptors` to 0.39.8 within the existing version
range.

Signed-off-by: Fredrik Adelöw <freben@spotify.com>
Made-with: Cursor
2026-04-15 22:02:18 +02:00
github-actions[bot] 93e643d142 Version Packages 2026-04-14 14:57:31 +00:00
github-actions[bot] 6c10d88c13 Version Packages (next) 2026-04-07 15:30:58 +00:00
github-actions[bot] a2cb332e25 Version Packages (next) 2026-03-31 15:30:51 +00:00
github-actions[bot] c1b510cabb Version Packages (next) 2026-03-24 14:54:00 +00:00
github-actions[bot] 5725b5fcfa Version Packages 2026-03-17 21:39:07 +00:00
Gabriel Dugny a49a40d314 Proper /v3 usage everywhere
Signed-off-by: Gabriel Dugny <gabriel.dugny@believe.com>
2026-03-17 16:48:42 +01:00
Patrik Oldsberg ec794b9e8b frontend-app-api: fix changed-package lint regressions
Declare the new frontend test dependencies, avoid the finalize options shadowing lint error, and add explicit assertions in frontend-test-utils so the changed-package lint jobs pass again.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:05:00 +01:00
Patrik Oldsberg e66bbfc85c frontend-test-utils: prepare apps before finalizing
Move the test app helpers over to prepareSpecializedApp().finalize() so they stop depending on the deprecated createSpecializedApp entrypoint.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-17 13:03:57 +01:00
github-actions[bot] ed7c4e3bef Version Packages (next) 2026-03-10 17:34:12 +00:00
Patrik Oldsberg 3b0c46e272 deprecate MockFetchApi class, keep MockFetchApiOptions
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-05 13:56:51 +01:00
Patrik Oldsberg ec9665666a fix api report generation to use standard pipeline flags
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-05 13:51:32 +01:00
Patrik Oldsberg b56f573815 frontend-test-utils: deprecate standalone mock API exports
Deprecate all standalone mock API exports in favor of the `mockApis`
namespace. This includes the mock classes, their option types, and
the `ErrorWithContext` type. Inline option types into the `mockApis`
function signatures to avoid dependence on the deprecated types.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Made-with: Cursor
2026-03-05 13:14:55 +01:00
github-actions[bot] db0d171511 Version Packages (next) 2026-03-03 14:16:49 +00:00
Patrik Oldsberg fba2809b20 frontend-test-utils: add type tests for TestApiProvider
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-27 23:45:54 +01:00
Patrik Oldsberg 479282f38e frontend-test-utils: fix TestApiPair type inference for tuple syntax
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-27 21:23:18 +01:00
github-actions[bot] 4bd6a3a1af Version Packages (next) 2026-02-24 19:24:06 +00:00
Patrik Oldsberg 909c742c18 Stabilize translation API in the new frontend system
Remove @alpha tags from translation-related types and switch all
translation API imports in new frontend system packages to use stable
paths from @backstage/frontend-plugin-api instead of
@backstage/core-plugin-api/alpha.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-23 21:23:05 +01:00
Andre Wanlin 4541817031 Updated API reports due to the package change
Signed-off-by: Andre Wanlin <awanlin@spotify.com>
2026-02-23 06:29:04 -06:00
github-actions[bot] e6df5d52ce Version Packages 2026-02-17 16:06:18 +00:00
Patrik Oldsberg d56d9eae3c Explicitly disable v7 future flags to suppress warnings
Rather than removing the future prop, set v7_relativeSplatPath and
v7_startTransition to false so react-router stops logging deprecation
warnings.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-13 15:09:23 +01:00
Patrik Oldsberg 47d064a51b Revert react-router v7 future flags from #31818
Roll back the v7_relativeSplatPath and v7_startTransition future flags
and the Outlet-based route structure, keeping the version bump to
react-router-dom@^6.30.2.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-12 10:03:13 +01:00
github-actions[bot] 7c41134684 Version Packages (next) 2026-02-10 16:14:59 +00:00
Patrik Oldsberg 8fa6ef3452 frontend-test-utils: review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-10 10:42:32 +01:00
Patrik Oldsberg a7d4a3109c frontend-test-utils: consistent internal types for test api pairs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-09 20:37:36 +01:00
Patrik Oldsberg 2d77cacd84 frontend-test-utils: add @types/jest peer dep
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-09 19:44:20 +01:00
Patrik Oldsberg 7ee7f122a8 frontend-test-utils: adjust fetch mock + add createApiMock
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-09 19:22:58 +01:00
Patrik Oldsberg 3f19d5ec32 frontend-test-utils: review fixes for readonly fields and config constructor
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-09 14:20:57 +01:00
Patrik Oldsberg b9d90a7140 frontend-test-utils: review and type fixes + cleanup
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-07 11:37:37 +01:00
Patrik Oldsberg f4bb4d1983 frontend-test-utils: remove redundant .factory util
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-07 00:34:36 +01:00
Patrik Oldsberg b9110a5724 frontend-test-utils: api cleanup, remove TestApiRegistry
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-06 22:48:22 +01:00
Patrik Oldsberg a18c64a285 frontend-test-utils: mock type exports comment
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:53:12 +01:00
Patrik Oldsberg 6362ca4b17 catalog-react: factory mock shortcut for catalogApiMock
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:50:30 +01:00