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>
This commit is contained in:
Patrik Oldsberg
2026-02-04 22:42:24 +01:00
parent be7c1d73b2
commit d2ac2ec49d
13 changed files with 929 additions and 3 deletions
+2
View File
@@ -3961,9 +3961,11 @@ __metadata:
"@backstage/version-bridge": "workspace:^"
"@testing-library/jest-dom": "npm:^6.0.0"
"@types/react": "npm:^18.0.0"
"@types/zen-observable": "npm:^0.8.0"
react: "npm:^18.0.2"
react-dom: "npm:^18.0.2"
react-router-dom: "npm:^6.30.2"
zen-observable: "npm:^0.10.0"
zod: "npm:^3.25.76"
peerDependencies:
"@testing-library/react": ^16.0.0