diff --git a/packages/frontend-app-api/src/wiring/createApp.tsx b/packages/frontend-app-api/src/wiring/createApp.tsx index 109bb0b0ed..63dae872b9 100644 --- a/packages/frontend-app-api/src/wiring/createApp.tsx +++ b/packages/frontend-app-api/src/wiring/createApp.tsx @@ -22,7 +22,6 @@ import { AppTreeApi, appTreeApiRef, coreExtensionData, - ExtensionDefinition, FrontendFeature, RouteRef, ExternalRouteRef, diff --git a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx b/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx index 6e725324a1..cda0085fec 100644 --- a/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx +++ b/packages/frontend-plugin-api/src/blueprints/AppRootWrapperBlueprint.test.tsx @@ -16,15 +16,13 @@ import React from 'react'; import { AppRootWrapperBlueprint } from './AppRootWrapperBlueprint'; -import { render, screen, waitFor } from '@testing-library/react'; +import { screen, waitFor } from '@testing-library/react'; import { coreExtensionData, createExtension, createExtensionInput, - createFrontendPlugin, } from '../wiring'; -import { createSpecializedApp } from '@backstage/frontend-app-api'; -import { MockConfigApi } from '@backstage/test-utils'; +import { renderInTestApp } from '@backstage/frontend-test-utils'; describe('AppRootWrapperBlueprint', () => { it('should return an extension with sensible defaults', () => { @@ -61,27 +59,20 @@ describe('AppRootWrapperBlueprint', () => { it('should render the simple component wrapper', async () => { const extension = AppRootWrapperBlueprint.make({ + name: 'test', params: { Component: () =>
Hello
, }, }); - const app = createSpecializedApp({ - features: [ - createFrontendPlugin({ - id: 'test', - extensions: [extension], - }), - ], - }); - - render(app.createRoot()); + renderInTestApp(
, { extensions: [extension] }); await waitFor(() => expect(screen.getByText('Hello')).toBeInTheDocument()); }); it('should render the complex component wrapper', async () => { const extension = AppRootWrapperBlueprint.makeWithOverrides({ + name: 'test', config: { schema: { name: z => z.string(), @@ -104,24 +95,17 @@ describe('AppRootWrapperBlueprint', () => { }, }); - const app = createSpecializedApp({ - features: [ - createFrontendPlugin({ - id: 'test', - extensions: [ - extension, - createExtension({ - name: 'test-child', - attachTo: { id: 'app-root-wrapper:test', input: 'children' }, - output: [coreExtensionData.reactElement], - factory: () => [ - coreExtensionData.reactElement(
Its Me
), - ], - }), - ], + renderInTestApp(
, { + extensions: [ + extension, + createExtension({ + name: 'test-child', + attachTo: { id: 'app-root-wrapper:test', input: 'children' }, + output: [coreExtensionData.reactElement], + factory: () => [coreExtensionData.reactElement(
Its Me
)], }), ], - config: new MockConfigApi({ + config: { app: { extensions: [ { @@ -129,11 +113,9 @@ describe('AppRootWrapperBlueprint', () => { }, ], }, - }), + }, }); - render(app.createRoot()); - await waitFor(() => { expect(screen.getByTestId('Robin-1')).toBeInTheDocument(); expect(screen.getByText('Its Me')).toBeInTheDocument();