changesets: added changesets for frontend-test-utils api mock changes

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2026-02-06 22:59:53 +01:00
parent b9110a5724
commit 09a6aadcc9
3 changed files with 29 additions and 0 deletions
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/frontend-test-utils': minor
---
**BREAKING**: Removed the `TestApiRegistry` class, use `TestApiProvider` directory instead, storing resused APIs in an a variable instead, e.g. `const apis = [...] as const`.
@@ -0,0 +1,5 @@
---
'@backstage/plugin-catalog-react': patch
---
The `catalogApiMock` test utility now returns a `MockWithApiFactory`, allowing it to be passed directly to test utilities like `renderTestApp` and `TestApiProvider` without needing the `[catalogApiRef, catalogApiMock()]` tuple.
@@ -0,0 +1,19 @@
---
'@backstage/frontend-test-utils': patch
---
Added a new `mockApis` namespace with mock implementations of many core APIs. Mock API instances can be passed directly to `TestApiProvider`, `renderInTestApp`, and `renderTestApp` without needing `[apiRef, impl]` tuples.
```tsx
// Before
import { mockApis } from '@backstage/frontend-test-utils';
renderInTestApp(<MyComponent />, {
apis: [[identityApiRef, mockApis.identity()]],
});
// After - mock APIs can be passed directly
renderInTestApp(<MyComponent />, {
apis: [mockApis.identity()],
});
```