import * as _backstage_config from '@backstage/config'; import { Config } from '@backstage/config'; import * as _backstage_frontend_plugin_api from '@backstage/frontend-plugin-api'; import { ApiFactory, ApiRef, AlertApi, AlertMessage, FeatureFlagsApi, FeatureFlagState, FeatureFlag, FeatureFlagsSaveOptions, AnalyticsApi, AnalyticsEvent, TranslationApi, TranslationRef, TranslationSnapshot, ConfigApi as ConfigApi$1, DiscoveryApi as DiscoveryApi$1, IdentityApi as IdentityApi$1, StorageApi as StorageApi$1, ErrorApi as ErrorApi$1, FetchApi as FetchApi$1, ExtensionDataRef, AppNode, ExtensionDefinitionParameters, ExtensionDefinition, RouteRef, ExternalRouteRef, FrontendFeature } from '@backstage/frontend-plugin-api'; import { PermissionApi } from '@backstage/plugin-permission-react'; import { Observable, JsonObject, JsonValue } from '@backstage/types'; import { EvaluatePermissionRequest, AuthorizeResult, EvaluatePermissionResponse } from '@backstage/plugin-permission-common'; import { ConfigApi, ErrorApiError, ErrorApiErrorContext, ErrorApi, FetchApi, DiscoveryApi, IdentityApi, StorageApi, StorageValueSnapshot } from '@backstage/core-plugin-api'; import { ReactNode } from 'react'; import { RenderResult } from '@testing-library/react'; export { registerMswTestHooks, withLogCollector } from '@backstage/test-utils'; /** * Symbol used to mark mock API instances with their corresponding API factory. * * @ignore */ declare const mockApiFactorySymbol: unique symbol; /** * Symbol used to mark mock API instances with their corresponding API factory. * This allows mock APIs to be passed directly to test utilities without * needing to explicitly provide the [apiRef, implementation] tuple. * * @public */ type MockApiFactorySymbol = typeof mockApiFactorySymbol; /** * Type for an API instance that has been marked as a mock API. * * @public */ type MockWithApiFactory = TApi & { [mockApiFactorySymbol]: ApiFactory; }; /** * Attaches mock API factory metadata to an API instance, allowing it to be * passed directly to test utilities without needing to explicitly provide * the [apiRef, implementation] tuple. * * @public * @example * ```ts * const catalogApi = attachMockApiFactory( * catalogApiRef, * new InMemoryCatalogClient() * ); * // Can now be passed directly to TestApiProvider * * ``` */ declare function attachMockApiFactory(apiRef: ApiRef, implementation: TImpl): TImpl & { [mockApiFactorySymbol]: ApiFactory; }; /** * Represents a mocked version of an API, where you automatically have access to * the mocked versions of all of its methods along with a factory that returns * that same mock. * * @public */ type ApiMock = { [mockApiFactorySymbol]: ApiFactory; } & { [Key in keyof TApi]: TApi[Key] extends (...args: infer Args) => infer Return ? TApi[Key] & jest.MockInstance : TApi[Key]; }; /** * Creates a standardized Backstage Utility API mockfactory function for * producing mock API instances. * * @remarks * * Each method in the mock factory is a `jest.fn()`, and you can optionally pass * partial implementations when calling the returned function. No type * parameters should be provided to this function, they will be inferred from * the provided API reference. * * @public * @example * ```ts * import { createApiMock } from '@backstage/frontend-test-utils'; * import { myApiRef } from '../apis'; * * // Set up the mock factory * const mock = createApiMock(myApiRef, () => ({ * greet: jest.fn(), * })); * * // Create a mock with default behavior * const api = mock(); * * // Or with a partial implementation * const api = mock({ greet: async () => 'Hello!' }); * expect(api.greet).toHaveBeenCalledTimes(1); * ``` */ declare function createApiMock(apiRef: ApiRef, mockFactory: () => jest.Mocked): (partialImpl?: Partial) => ApiMock; /** * Mock implementation of {@link @backstage/frontend-plugin-api#AlertApi} for testing alert behavior. * * @public * @deprecated Use `mockApis.alert()` instead. * @example * ```ts * const alertApi = mockApis.alert(); * alertApi.post({ message: 'Test alert' }); * expect(alertApi.getAlerts()).toHaveLength(1); * ``` */ declare class MockAlertApi implements AlertApi { private readonly alerts; private readonly observers; post(alert: AlertMessage): void; alert$(): Observable; /** * Get all alerts that have been posted. */ getAlerts(): AlertMessage[]; /** * Clear all collected alerts. */ clearAlerts(): void; /** * Wait for an alert matching the given predicate. * * @param predicate - Function to test each alert * @param timeoutMs - Maximum time to wait in milliseconds * @returns Promise that resolves with the matching alert */ waitForAlert(predicate: (alert: AlertMessage) => boolean, timeoutMs?: number): Promise; } /** * Options for configuring {@link MockFeatureFlagsApi}. * * @public * @deprecated Use `mockApis.featureFlags()` instead. */ interface MockFeatureFlagsApiOptions { /** * Initial feature flag states. */ initialStates?: Record; } /** * Mock implementation of {@link @backstage/frontend-plugin-api#FeatureFlagsApi} for testing feature flag behavior. * * @public * @deprecated Use `mockApis.featureFlags()` instead. * @example * ```ts * const api = mockApis.featureFlags({ * initialStates: { 'my-feature': FeatureFlagState.Active }, * }); * expect(api.isActive('my-feature')).toBe(true); * ``` */ declare class MockFeatureFlagsApi implements FeatureFlagsApi { private readonly registeredFlags; private readonly states; constructor(options?: MockFeatureFlagsApiOptions); registerFlag(flag: FeatureFlag): void; getRegisteredFlags(): FeatureFlag[]; isActive(name: string): boolean; save(options: FeatureFlagsSaveOptions): void; /** * Get the current state of all feature flags as a record. */ getState(): Record; /** * Set the state of multiple feature flags. */ setState(states: Record): void; /** * Clear all feature flag states. */ clearState(): void; } /** * Mock implementation of {@link frontend-plugin-api#AnalyticsApi} with helpers to ensure that events are sent correctly. * Use getEvents in tests to verify captured events. * * @public * @deprecated Use `mockApis.analytics()` instead. */ declare class MockAnalyticsApi implements AnalyticsApi { private events; captureEvent(event: AnalyticsEvent): void; getEvents(): AnalyticsEvent[]; } /** * MockConfigApi is a thin wrapper around {@link @backstage/config#ConfigReader} * that can be used to mock configuration using a plain object. * * @public * @deprecated Use `mockApis.config()` instead. * @example * ```tsx * const mockConfig = mockApis.config({ * data: { app: { baseUrl: 'https://example.com' } }, * }); * * const rendered = await renderInTestApp( * * * , * ); * ``` */ declare class MockConfigApi implements ConfigApi { private readonly config; constructor({ data }: { data: JsonObject; }); /** {@inheritdoc @backstage/config#Config.has} */ has(key: string): boolean; /** {@inheritdoc @backstage/config#Config.keys} */ keys(): string[]; /** {@inheritdoc @backstage/config#Config.get} */ get(key?: string): T; /** {@inheritdoc @backstage/config#Config.getOptional} */ getOptional(key?: string): T | undefined; /** {@inheritdoc @backstage/config#Config.getConfig} */ getConfig(key: string): Config; /** {@inheritdoc @backstage/config#Config.getOptionalConfig} */ getOptionalConfig(key: string): Config | undefined; /** {@inheritdoc @backstage/config#Config.getConfigArray} */ getConfigArray(key: string): Config[]; /** {@inheritdoc @backstage/config#Config.getOptionalConfigArray} */ getOptionalConfigArray(key: string): Config[] | undefined; /** {@inheritdoc @backstage/config#Config.getNumber} */ getNumber(key: string): number; /** {@inheritdoc @backstage/config#Config.getOptionalNumber} */ getOptionalNumber(key: string): number | undefined; /** {@inheritdoc @backstage/config#Config.getBoolean} */ getBoolean(key: string): boolean; /** {@inheritdoc @backstage/config#Config.getOptionalBoolean} */ getOptionalBoolean(key: string): boolean | undefined; /** {@inheritdoc @backstage/config#Config.getString} */ getString(key: string): string; /** {@inheritdoc @backstage/config#Config.getOptionalString} */ getOptionalString(key: string): string | undefined; /** {@inheritdoc @backstage/config#Config.getStringArray} */ getStringArray(key: string): string[]; /** {@inheritdoc @backstage/config#Config.getOptionalStringArray} */ getOptionalStringArray(key: string): string[] | undefined; } /** * Constructor arguments for {@link MockErrorApi} * @public * @deprecated Use `mockApis.error()` instead. */ type MockErrorApiOptions = { collect?: boolean; }; /** * ErrorWithContext contains error and ErrorApiErrorContext * @public * @deprecated Use the return type of `MockErrorApi.getErrors` instead. */ type ErrorWithContext = { error: ErrorApiError; context?: ErrorApiErrorContext; }; /** * Mock implementation of the {@link core-plugin-api#ErrorApi} to be used in tests. * Includes withForError and getErrors methods for error testing. * @public * @deprecated Use `mockApis.error()` instead. */ declare class MockErrorApi implements ErrorApi { private readonly options; private readonly errors; private readonly waiters; constructor(options?: { collect?: boolean; }); post(error: ErrorApiError, context?: ErrorApiErrorContext): void; error$(): Observable<{ error: ErrorApiError; context?: ErrorApiErrorContext; }>; getErrors(): { error: ErrorApiError; context?: ErrorApiErrorContext; }[]; waitForError(pattern: RegExp, timeoutMs?: number): Promise<{ error: ErrorApiError; context?: ErrorApiErrorContext; }>; } /** * The options given when constructing a {@link MockFetchApi}. * * @public */ interface MockFetchApiOptions { /** * Define the underlying base `fetch` implementation. * * @defaultValue undefined * @remarks * * Leaving out this parameter or passing `undefined`, makes the API use the * global `fetch` implementation to make real network requests. * * `'none'` swallows all calls and makes no requests at all. * * You can also pass in any `fetch` compatible callback, such as a * `jest.fn()`, if you want to use a custom implementation or to just track * and assert on calls. */ baseImplementation?: undefined | 'none' | typeof fetch; /** * Add translation from `plugin://` URLs to concrete http(s) URLs, basically * simulating what * {@link @backstage/core-app-api#FetchMiddlewares.resolvePluginProtocol} * does. * * @defaultValue undefined * @remarks * * Leaving out this parameter or passing `undefined`, disables plugin protocol * translation. * * To enable the feature, pass in a discovery API which is then used to * resolve the URLs. */ resolvePluginProtocol?: undefined | { discoveryApi: Pick; }; /** * Add token based Authorization headers to requests, basically simulating * what {@link @backstage/core-app-api#FetchMiddlewares.injectIdentityAuth} * does. * * @defaultValue undefined * @remarks * * Leaving out this parameter or passing `undefined`, disables auth injection. * * To enable the feature, pass in either a static token or an identity API * which is queried on each request for a token. */ injectIdentityAuth?: undefined | { token: string; } | { identityApi: Pick; }; } /** * A test helper implementation of {@link @backstage/core-plugin-api#FetchApi}. * * @public * @deprecated Use `mockApis.fetch()` instead. */ declare class MockFetchApi implements FetchApi { private readonly implementation; /** * Creates a mock {@link @backstage/core-plugin-api#FetchApi}. */ constructor(options?: MockFetchApiOptions); /** {@inheritdoc @backstage/core-plugin-api#FetchApi.fetch} */ get fetch(): typeof fetch; } /** * Mock implementation of the {@link core-plugin-api#StorageApi} to be used in tests. * * @public * @deprecated Use `mockApis.storage()` instead. */ declare class MockStorageApi implements StorageApi { private readonly namespace; private readonly data; private readonly bucketStorageApis; private constructor(); static create(data?: JsonObject): MockStorageApi; forBucket(name: string): StorageApi; snapshot(key: string): StorageValueSnapshot; set(key: string, data: T): Promise; remove(key: string): Promise; observe$(key: string): Observable>; private getKeyName; private notifyChanges; private subscribers; private readonly observable; } /** * Mock implementation of * {@link @backstage/plugin-permission-react#PermissionApi}. Supply a * requestHandler function to override the mock result returned for a given * request. * * @public * @deprecated Use `mockApis.permission()` instead. */ declare class MockPermissionApi implements PermissionApi { private readonly requestHandler; constructor(requestHandler?: (request: EvaluatePermissionRequest) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); authorize(request: EvaluatePermissionRequest): Promise; } /** * Mock implementation of {@link @backstage/frontend-plugin-api#TranslationApi}. * * @public * @deprecated Use `mockApis.translation()` instead. */ declare class MockTranslationApi implements TranslationApi { #private; static create(): MockTranslationApi; private constructor(); getTranslation(translationRef: TranslationRef): TranslationSnapshot; translation$(): Observable>; } /** * Mock implementations of the core utility APIs, to be used in tests. * * @public * @remarks * * There are some variations among the APIs depending on what needs tests * might have, but overall there are two main usage patterns: * * 1: Creating an actual fake API instance, often with a simplified version * of functionality, by calling the mock API itself as a function. * * ```ts * // The function often accepts parameters that control its behavior * const foo = mockApis.foo(); * ``` * * 2: Creating a mock API, where all methods are replaced with jest mocks, by * calling the API's `mock` function. * * ```ts * // You can optionally supply a subset of its methods to implement * const foo = mockApis.foo.mock({ * someMethod: () => 'mocked result', * }); * // After exercising your test, you can make assertions on the mock: * expect(foo.someMethod).toHaveBeenCalledTimes(2); * expect(foo.otherMethod).toHaveBeenCalledWith(testData); * ``` */ declare namespace mockApis { /** * Fake implementation of {@link @backstage/frontend-plugin-api#AlertApi}. * * @public * @example * * ```tsx * const alertApi = mockApis.alert(); * alertApi.post({ message: 'Test alert' }); * expect(alertApi.getAlerts()).toHaveLength(1); * ``` */ function alert(): MockWithApiFactory; /** * Mock helpers for {@link @backstage/frontend-plugin-api#AlertApi}. * * @public */ namespace alert { /** * Creates a mock implementation of * {@link @backstage/frontend-plugin-api#AlertApi}. All methods are * replaced with jest mock functions, and you can optionally pass in a * subset of methods with an explicit implementation. * * @public */ const mock: (partialImpl?: Partial<_backstage_frontend_plugin_api.AlertApi> | undefined) => ApiMock<_backstage_frontend_plugin_api.AlertApi>; } /** * Fake implementation of {@link @backstage/frontend-plugin-api#FeatureFlagsApi}. * * @public * @example * * ```tsx * const featureFlagsApi = mockApis.featureFlags({ * initialStates: { 'my-feature': FeatureFlagState.Active }, * }); * expect(featureFlagsApi.isActive('my-feature')).toBe(true); * ``` */ function featureFlags(options?: { initialStates?: Record; }): MockWithApiFactory; /** * Mock helpers for {@link @backstage/frontend-plugin-api#FeatureFlagsApi}. * * @public */ namespace featureFlags { /** * Creates a mock implementation of * {@link @backstage/frontend-plugin-api#FeatureFlagsApi}. All methods are * replaced with jest mock functions, and you can optionally pass in a * subset of methods with an explicit implementation. * * @public */ const mock: (partialImpl?: Partial<_backstage_frontend_plugin_api.FeatureFlagsApi> | undefined) => ApiMock<_backstage_frontend_plugin_api.FeatureFlagsApi>; } /** * Fake implementation of {@link @backstage/core-plugin-api#AnalyticsApi}. * * @public */ function analytics(): MockAnalyticsApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#AnalyticsApi}. * * @public */ namespace analytics { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/frontend-plugin-api#TranslationApi}. * By default returns the default translation. * * @public */ function translation(): MockTranslationApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/frontend-plugin-api#TranslationApi}. * * @public */ namespace translation { /** * Creates a mock of {@link @backstage/frontend-plugin-api#TranslationApi}. * * @public */ const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/core-plugin-api#ConfigApi}. * * @public */ function config(options?: { data?: JsonObject; }): MockConfigApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#ConfigApi}. * * @public */ namespace config { const mock: (partialImpl?: Partial<_backstage_config.Config> | undefined) => ApiMock<_backstage_config.Config>; } /** * Fake implementation of {@link @backstage/core-plugin-api#DiscoveryApi}. * * @public */ function discovery(options?: { baseUrl?: string; }): DiscoveryApi$1 & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#DiscoveryApi}. * * @public */ namespace discovery { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/core-plugin-api#IdentityApi}. * * @public */ function identity(options?: { userEntityRef?: string; ownershipEntityRefs?: string[]; token?: string; email?: string; displayName?: string; picture?: string; }): MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#IdentityApi}. * * @public */ namespace identity { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/plugin-permission-react#PermissionApi}. * * @public */ function permission(options?: { authorize?: AuthorizeResult.ALLOW | AuthorizeResult.DENY | ((request: EvaluatePermissionRequest) => AuthorizeResult.ALLOW | AuthorizeResult.DENY); }): MockPermissionApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/plugin-permission-react#PermissionApi}. * * @public */ namespace permission { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/core-plugin-api#StorageApi}. * * @public */ function storage(options?: { data?: JsonObject; }): MockStorageApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#StorageApi}. * * @public */ namespace storage { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/core-plugin-api#ErrorApi}. * * @public */ function error(options?: { collect?: boolean; }): MockErrorApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#ErrorApi}. * * @public */ namespace error { const mock: (partialImpl?: Partial | undefined) => ApiMock; } /** * Fake implementation of {@link @backstage/core-plugin-api#FetchApi}. * * @public */ function fetch(options?: MockFetchApiOptions): MockFetchApi & MockWithApiFactory; /** * Mock helpers for {@link @backstage/core-plugin-api#FetchApi}. * * @public */ namespace fetch { const mock: (partialImpl?: Partial | undefined) => ApiMock; } } /** * Represents a single API implementation, either as a tuple of the reference and the implementation, or a mock with an embedded factory. * @public */ type TestApiPair = readonly [ApiRef, TApi extends infer TImpl ? Partial : never] | MockWithApiFactory>; /** * Represents an array of mock API implementation. * @public */ type TestApiPairs = { [TIndex in keyof TApiPairs]: TestApiPair; }; /** * Properties for the {@link TestApiProvider} component. * * @public */ type TestApiProviderProps = { apis: readonly [...TestApiPairs]; children: ReactNode; }; /** * The `TestApiProvider` is a Utility API context provider for standalone rendering * scenarios where you're not using `renderInTestApp` or other test utilities. * * It lets you provide any number of API implementations, without necessarily * having to fully implement each of the APIs. * * @remarks * * For most test scenarios, prefer using the `apis` option in `renderInTestApp` or * `createExtensionTester` instead of wrapping components with `TestApiProvider`. * * @example * ```tsx * import { render } from '\@testing-library/react'; * import { myCustomApiRef } from '../apis'; * import { TestApiProvider, mockApis } from '\@backstage/frontend-test-utils'; * * // Mock custom APIs with tuple syntax * const myCustomApiMock = { myMethod: jest.fn() }; * render( * * * * ); * * // Use with built-in mock APIs (no tuples needed) * render( * * * * ); * ``` * * @public */ declare function TestApiProvider(props: TestApiProviderProps): JSX.Element; /** * Represents a snapshot of an extension in the app tree. * * @public */ interface ExtensionSnapshotNode { /** The ID of the extension */ id: string; /** The IDs of output data refs produced by this extension */ outputs?: string[]; /** Child extensions organized by input name */ children?: Record; /** Whether this extension is disabled */ disabled?: true; } /** @public */ declare class ExtensionQuery { #private; constructor(node: AppNode); get node(): AppNode; get instance(): _backstage_frontend_plugin_api.AppNodeInstance; get(ref: ExtensionDataRef): UOutput extends ExtensionDataRef ? IConfig['optional'] extends true ? IData | undefined : IData : never; } /** @public */ declare class ExtensionTester { #private; private constructor(); add(extension: ExtensionDefinition, options?: { config?: T['configInput']; }): ExtensionTester; get(ref: ExtensionDataRef): UOutput extends ExtensionDataRef ? IConfig['optional'] extends true ? IData | undefined : IData : never; query(extension: ExtensionDefinition): ExtensionQuery>; reactElement(): JSX.Element; /** * Returns a snapshot of the extension tree structure for testing and debugging. * Convenient to use with Jest's inline snapshot testing. * * @example * ```tsx * const tester = createExtensionTester(myExtension); * expect(tester.snapshot()).toMatchInlineSnapshot(); * ``` */ snapshot(): ExtensionSnapshotNode; } /** @public */ declare function createExtensionTester(subject: ExtensionDefinition, options?: { config?: T['configInput']; apis?: readonly [...TestApiPairs]; }): ExtensionTester>; /** * Options to customize the behavior of the test app. * @public */ type TestAppOptions = { /** * An object of paths to mount route ref on, with the key being the path and the value * being the route ref that the path will be bound to. This allows the route refs to be * used by `useRouteRef` in the rendered elements. * * @example * ```ts * renderInTestApp(, { * mountedRoutes: { * '/my-path': myRouteRef, * } * }) * // ... * const link = useRouteRef(myRouteRef) * ``` */ mountedRoutes?: { [path: string]: RouteRef | ExternalRouteRef; }; /** * Additional configuration passed to the app when rendering elements inside it. */ config?: JsonObject; /** * Additional features to add to the test app. */ features?: FrontendFeature[]; /** * The route path pattern that the test element is rendered at. When set, * the element is wrapped in a `` with this path, enabling * `useParams()` to extract parameters from the URL. * * Should be used together with `initialRouteEntries` to set a concrete * URL that matches the pattern. * * @example * ```ts * renderInTestApp(, { * mountPath: '/catalog/:namespace/:kind/:name', * initialRouteEntries: ['/catalog/default/component/my-entity'], * }) * ``` */ mountPath?: string; /** * Initial route entries to use for the router. */ initialRouteEntries?: string[]; /** * API overrides to provide to the test app. Use `mockApis` helpers * from `@backstage/frontend-test-utils` to create mock implementations. * * @example * ```ts * import { mockApis } from '@backstage/frontend-test-utils'; * * renderInTestApp(, { * apis: [mockApis.identity({ userEntityRef: 'user:default/guest' })], * }) * ``` */ apis?: readonly [...TestApiPairs]; }; /** * @public * Renders the given element in a test app, for use in unit tests. */ declare function renderInTestApp(element: JSX.Element, options?: TestAppOptions): RenderResult; /** * Options for `renderTestApp`. * * @public */ type RenderTestAppOptions = { /** * Additional configuration passed to the app when rendering elements inside it. */ config?: JsonObject; /** * Additional extensions to add to the test app. */ extensions?: ExtensionDefinition[]; /** * Additional features to add to the test app. */ features?: FrontendFeature[]; /** * Initial route entries to use for the router. */ initialRouteEntries?: string[]; /** * An object of paths to mount route refs on, with the key being the path and * the value being the route ref that the path will be bound to. This allows * the route refs to be used by `useRouteRef` in the rendered elements. * * @example * ```ts * renderTestApp({ * mountedRoutes: { * '/my-path': myRouteRef, * }, * extensions: [...], * }) * ``` */ mountedRoutes?: { [path: string]: RouteRef | ExternalRouteRef; }; /** * API overrides to provide to the test app. Use `mockApis` helpers * from `@backstage/frontend-test-utils` to create mock implementations. * * @example * ```ts * import { mockApis } from '@backstage/frontend-test-utils'; * * renderTestApp({ * apis: [mockApis.identity({ userEntityRef: 'user:default/guest' })], * extensions: [...], * }) * ``` */ apis?: readonly [...TestApiPairs]; }; /** * Renders the provided extensions inside a Backstage app, returning the same * utilities as `@testing-library/react` `render` function. * * @public */ declare function renderTestApp(options?: RenderTestAppOptions): RenderResult; export { ExtensionQuery, ExtensionTester, MockAlertApi, MockAnalyticsApi, MockConfigApi, MockErrorApi, MockFeatureFlagsApi, MockFetchApi, MockPermissionApi, MockStorageApi, MockTranslationApi, TestApiProvider, attachMockApiFactory, createApiMock, createExtensionTester, mockApis, renderInTestApp, renderTestApp }; export type { ApiMock, ErrorWithContext, ExtensionSnapshotNode, MockApiFactorySymbol, MockErrorApiOptions, MockFeatureFlagsApiOptions, MockFetchApiOptions, MockWithApiFactory, RenderTestAppOptions, TestApiPair, TestApiPairs, TestApiProviderProps, TestAppOptions };