frontend-test-utils: prepare apps before finalizing
Move the test app helpers over to prepareSpecializedApp().finalize() so they stop depending on the deprecated createSpecializedApp entrypoint. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -16,7 +16,7 @@
|
||||
|
||||
import { Fragment } from 'react';
|
||||
import { Link, MemoryRouter } from 'react-router-dom';
|
||||
import { createSpecializedApp } from '@backstage/frontend-app-api';
|
||||
import { prepareSpecializedApp } from '@backstage/frontend-app-api';
|
||||
import { RenderResult, render } from '@testing-library/react';
|
||||
import { ConfigReader } from '@backstage/config';
|
||||
import { JsonObject } from '@backstage/types';
|
||||
@@ -233,7 +233,7 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
|
||||
features.push(...options.features);
|
||||
}
|
||||
|
||||
const app = createSpecializedApp({
|
||||
const app = prepareSpecializedApp({
|
||||
features,
|
||||
config: ConfigReader.fromConfigs([
|
||||
{
|
||||
@@ -251,7 +251,7 @@ export function renderInTestApp<const TApiPairs extends any[] = any[]>(
|
||||
return createApiFactory(apiRef, implementation);
|
||||
}),
|
||||
},
|
||||
} as CreateSpecializedAppInternalOptions);
|
||||
} as CreateSpecializedAppInternalOptions).finalize();
|
||||
|
||||
return render(
|
||||
app.tree.root.instance!.getData(coreExtensionData.reactElement),
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
*/
|
||||
|
||||
import { Fragment } from 'react';
|
||||
import { createSpecializedApp } from '@backstage/frontend-app-api';
|
||||
import { prepareSpecializedApp } from '@backstage/frontend-app-api';
|
||||
import {
|
||||
coreExtensionData,
|
||||
createApiFactory,
|
||||
@@ -175,7 +175,7 @@ export function renderTestApp<const TApiPairs extends any[] = any[]>(
|
||||
features.push(...options.features);
|
||||
}
|
||||
|
||||
const app = createSpecializedApp({
|
||||
const app = prepareSpecializedApp({
|
||||
features,
|
||||
config: ConfigReader.fromConfigs([
|
||||
{
|
||||
@@ -193,7 +193,7 @@ export function renderTestApp<const TApiPairs extends any[] = any[]>(
|
||||
return createApiFactory(apiRef, implementation);
|
||||
}),
|
||||
},
|
||||
} as CreateSpecializedAppInternalOptions);
|
||||
} as CreateSpecializedAppInternalOptions).finalize();
|
||||
|
||||
return render(
|
||||
app.tree.root.instance!.getData(coreExtensionData.reactElement),
|
||||
|
||||
Reference in New Issue
Block a user