Merge pull request #22187 from backstage/rugvip/proxy-test

core-components: add test for ProxiedSignInPage
This commit is contained in:
Patrik Oldsberg
2024-01-17 19:30:11 +01:00
committed by GitHub
6 changed files with 119 additions and 0 deletions
+2
View File
@@ -7,6 +7,7 @@ import { AnalyticsApi } from '@backstage/core-plugin-api';
import { AnalyticsEvent } from '@backstage/core-plugin-api';
import { ApiHolder } from '@backstage/core-plugin-api';
import { ApiRef } from '@backstage/core-plugin-api';
import { AppComponents } from '@backstage/core-plugin-api';
import { AuthorizeResult } from '@backstage/plugin-permission-common';
import { ComponentType } from 'react';
import { Config } from '@backstage/config';
@@ -243,6 +244,7 @@ export type TestAppOptions = {
mountedRoutes?: {
[path: string]: RouteRef | ExternalRouteRef;
};
components?: Partial<AppComponents>;
};
// @public
@@ -25,6 +25,7 @@ import { themes, UnifiedThemeProvider } from '@backstage/theme';
import MockIcon from '@material-ui/icons/AcUnit';
import { createSpecializedApp } from '@backstage/core-app-api';
import {
AppComponents,
attachComponentData,
BootErrorPageProps,
createRouteRef,
@@ -101,6 +102,11 @@ export type TestAppOptions = {
* const link = useRouteRef(myRouteRef)
*/
mountedRoutes?: { [path: string]: RouteRef | ExternalRouteRef };
/**
* Components to be forwarded to the `components` option of `createApp`.
*/
components?: Partial<AppComponents>;
};
function isExternalRouteRef(
@@ -137,6 +143,7 @@ export function createTestAppWrapper(
Router: ({ children }) => (
<MemoryRouter initialEntries={routeEntries} children={children} />
),
...options.components,
},
icons: mockIcons,
plugins: [],