feat: added flags to pass through to specialized app

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-07-17 10:04:54 +02:00
parent 4337750bdd
commit ab8c34bc01
2 changed files with 34 additions and 0 deletions
@@ -282,6 +282,38 @@ describe('createApp', () => {
).resolves.toBeInTheDocument();
});
it('should allow unknown extension config if the flag is set', async () => {
const app = createApp({
configLoader: async () => ({
config: mockApis.config({
data: {
app: {
extensions: [{ 'unknown:lols/wut': false }],
},
},
}),
}),
features: [
appPlugin,
createFrontendPlugin({
pluginId: 'test',
extensions: [
PageBlueprint.make({
params: {
defaultPath: '/',
loader: async () => <div>Derp</div>,
},
}),
],
}),
],
flags: { allowUnknownExtensionConfig: true },
});
await renderWithEffects(app.createRoot());
await expect(screen.findByText('Derp')).resolves.toBeInTheDocument();
});
it('should make the app structure available through the AppTreeApi', async () => {
let appTreeApi: AppTreeApi | undefined = undefined;
@@ -80,6 +80,7 @@ export interface CreateAppOptions {
| ExtensionFactoryMiddleware
| ExtensionFactoryMiddleware[];
pluginInfoResolver?: FrontendPluginInfoResolver;
flags?: { allowUnknownExtensionConfig?: boolean };
}
/**
@@ -115,6 +116,7 @@ export function createApp(options?: CreateAppOptions): {
bindRoutes: options?.bindRoutes,
extensionFactoryMiddleware: options?.extensionFactoryMiddleware,
pluginInfoResolver: options?.pluginInfoResolver,
flags: options?.flags,
});
const rootEl = app.tree.root.instance!.getData(