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
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
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
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>
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>
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>
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>
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>
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>