feat: added flags to pass through to specialized app
Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user