Commit Graph

274 Commits

Author SHA1 Message Date
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
Patrik Oldsberg 0d7e331265 frontend-test-utils: shorthand mocks everywhere
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:50:29 +01:00
Patrik Oldsberg 14611301e5 frontend-test-utils: copy over all mock APIs
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:50:29 +01:00
Patrik Oldsberg a20cbb2514 frontend-test-utils: new utility for passing mock APIs directly
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:50:29 +01:00
Patrik Oldsberg d2ac2ec49d Add MockAlertApi and MockFeatureFlagsApi to frontend-test-utils
Introduces comprehensive mock implementations for AlertApi and FeatureFlagsApi in @backstage/frontend-test-utils, following the 3-pattern approach (function, factory, mock) for consistency with existing test utilities.

The new mocks include useful testing methods:
- MockAlertApi: clearAlerts(), waitForAlert(), getAlerts()
- MockFeatureFlagsApi: getState(), setState(), clearState()

Also adds a mockApis namespace that provides these new mocks and re-exports existing mockApis from @backstage/test-utils for backwards compatibility.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-05 23:50:28 +01:00
Patrik Oldsberg 15ed3f9ccb Add extension snapshot testing support to frontend-test-utils
Adds the snapshot() method to ExtensionTester, enabling snapshot
testing of extension tree structures. The snapshots use a tree-shaped
format that mirrors the extension hierarchy, with empty fields and
default values omitted for clarity.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-04 10:37:33 +01:00
Patrik Oldsberg 013ec22eab frontend-test-utils: add mountedRoutes option for renderTestApp + document
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 23:05:57 +01:00
Paul Schultz a7e0d506a2 feat: enable react router feature flags for v7
Signed-off-by: Paul Schultz <pschultz@pobox.com>
2026-02-03 09:37:11 -06:00
github-actions[bot] 1ea737c1e2 Version Packages (next) 2026-02-03 14:24:29 +00:00
Patrik Oldsberg 1911ebac7f frontend-test-utils: also add apis option to renderTestApp
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 10:41:11 +01:00
Patrik Oldsberg 062e9dcf09 frontend-test-utils: update docs for TestApiProvider and friends
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 00:11:48 +01:00
Patrik Oldsberg 68d2c57d94 docs: update to prefer new apis option and use mockApis
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 00:11:48 +01:00
Patrik Oldsberg 09032d7bd4 frontend-app-api: add internal app options
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 00:11:48 +01:00
Patrik Oldsberg 22864b75a9 feat(frontend-test-utils): add API override support to test utilities
Added support for API overrides in `createExtensionTester` and
`renderInTestApp` to allow tests to override specific APIs without
requiring wrapper components. This provides app-level API overrides
that are available throughout the entire extension tree.

The `apis` option follows the same typing pattern as `TestApiProvider`
from `@backstage/test-utils` for consistency and type safety.

Example usage:

```typescript
const tester = createExtensionTester(MyExtension, {
  apis: [
    [errorApiRef, mockErrorApi],
    [analyticsApiRef, mockAnalyticsApi],
  ],
});

renderInTestApp(<MyComponent />, {
  apis: [
    [errorApiRef, mockErrorApi],
    [analyticsApiRef, mockAnalyticsApi],
  ],
});
```

This enables cleaner tests with app-level API overrides, eliminating
the need to wrap components with TestApiProvider in many cases.

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-02-03 00:11:48 +01:00
github-actions[bot] d4b85dddee Version Packages (next) 2026-01-27 15:51:11 +00:00
Fredrik Adelöw 69d880e171 Bump to latest zod
Signed-off-by: Fredrik Adelöw <freben@gmail.com>
2026-01-26 13:52:02 +01:00
Patrik Oldsberg d7dd5bdc80 frontend-test-utils: fix Router deprecation warning
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
2026-01-21 10:34:44 +01:00
github-actions[bot] 2e902e7b43 Version Packages 2026-01-20 16:40:05 +00:00
Backstage Service Account 9f1ee3e667 Version Packages (next) (#32222)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2025-12-30 16:06:20 +01:00
github-actions[bot] c24788d5bb Version Packages 2025-12-16 14:08:20 +00:00
github-actions[bot] 756986e5e7 Version Packages (next) 2025-11-25 16:21:32 +00:00
github-actions[bot] 792f4d7e3d Version Packages 2025-11-18 12:23:09 +00:00
github-actions[bot] 807af8ce0e Version Packages (next) 2025-10-21 16:14:43 +00:00
github-actions[bot] d6ce2db9ca Version Packages 2025-10-14 15:29:54 +00:00
Vincenzo Scamporlino a8e223fa89 frontend-test-utils: marking as breaking
Signed-off-by: Vincenzo Scamporlino <vincenzos@spotify.com>
2025-10-13 15:14:02 +02:00