diff --git a/packages/frontend-test-utils/src/app/renderInTestApp.tsx b/packages/frontend-test-utils/src/app/renderInTestApp.tsx index a9275071b4..f75d871364 100644 --- a/packages/frontend-test-utils/src/app/renderInTestApp.tsx +++ b/packages/frontend-test-utils/src/app/renderInTestApp.tsx @@ -31,6 +31,7 @@ import { IconComponent, RouterBlueprint, NavItemBlueprint, + ExtensionOverrides, } from '@backstage/frontend-plugin-api'; /** @@ -60,6 +61,16 @@ export type TestAppOptions = { * 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?: ExtensionOverrides[]; }; const NavItem = (props: { @@ -167,12 +178,22 @@ export function renderInTestApp( } } + if (options?.extensions) { + extensions.push(...options.extensions); + } + + const features = [ + createExtensionOverrides({ + extensions, + }), + ]; + + if (options?.features) { + features.push(...options.features); + } + const app = createSpecializedApp({ - features: [ - createExtensionOverrides({ - extensions, - }), - ], + features, config: ConfigReader.fromConfigs([ { context: 'render-config', data: options?.config ?? {} }, ]),