test and review fixes
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
@@ -2,4 +2,4 @@
|
||||
'@backstage/create-app': patch
|
||||
---
|
||||
|
||||
Switched `next-app` template to use blueprint from `@backstage/plugin-app-react.
|
||||
Switched `next-app` template to use blueprint from `@backstage/plugin-app-react`.
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
---
|
||||
'@backstage/plugin-app-react': patch
|
||||
---
|
||||
|
||||
Internal refactor to move implementation of blueprints from `@backstage/frontend-plugin-api` to this package.
|
||||
@@ -60,8 +60,8 @@ describe('createApp', () => {
|
||||
}),
|
||||
},
|
||||
features: [
|
||||
createFrontendPlugin({
|
||||
pluginId: 'test',
|
||||
createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [
|
||||
ThemeBlueprint.make({
|
||||
name: 'derp',
|
||||
|
||||
@@ -200,6 +200,7 @@ describe('ApiBlueprint', () => {
|
||||
"test": {
|
||||
"$$type": "@backstage/ExtensionInput",
|
||||
"config": {
|
||||
"internal": false,
|
||||
"optional": false,
|
||||
"singleton": false,
|
||||
},
|
||||
|
||||
@@ -60,11 +60,11 @@ export interface ExtensionInput<
|
||||
* plugin. The following options are available:
|
||||
*
|
||||
* - `singleton`: If set to `true`, only one extension can be attached to the
|
||||
* input at a time. Additional extension will trigger an app error and be
|
||||
* input at a time. Additional extensions will trigger an app error and be
|
||||
* ignored.
|
||||
* - `optional`: If set to `true`, the input is optional and can be omitted,
|
||||
* this only has an effect if the `singleton` is set to `true`.
|
||||
* - `internal`: If set to `true`, only extensions from the same plugins will be
|
||||
* - `internal`: If set to `true`, only extensions from the same plugin will be
|
||||
* allowed to attach to this input. Other extensions will trigger an app error
|
||||
* and be ignored.
|
||||
*
|
||||
|
||||
@@ -20,6 +20,7 @@ import {
|
||||
coreExtensionData,
|
||||
createExtension,
|
||||
createExtensionInput,
|
||||
createFrontendModule,
|
||||
} from '@backstage/frontend-plugin-api';
|
||||
import { renderTestApp } from '@backstage/frontend-test-utils';
|
||||
|
||||
@@ -63,7 +64,11 @@ describe('AppRootWrapperBlueprint', () => {
|
||||
},
|
||||
});
|
||||
|
||||
renderTestApp({ extensions: [extension] });
|
||||
renderTestApp({
|
||||
features: [
|
||||
createFrontendModule({ pluginId: 'app', extensions: [extension] }),
|
||||
],
|
||||
});
|
||||
|
||||
await waitFor(() => expect(screen.getByText('Hello')).toBeInTheDocument());
|
||||
});
|
||||
@@ -95,20 +100,28 @@ describe('AppRootWrapperBlueprint', () => {
|
||||
});
|
||||
|
||||
renderTestApp({
|
||||
extensions: [
|
||||
extension,
|
||||
createExtension({
|
||||
name: 'test-child',
|
||||
attachTo: { id: 'app-root-wrapper:test', input: 'children' },
|
||||
output: [coreExtensionData.reactElement],
|
||||
factory: () => [coreExtensionData.reactElement(<div>Its Me</div>)],
|
||||
extensions: [],
|
||||
features: [
|
||||
createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [
|
||||
extension,
|
||||
createExtension({
|
||||
name: 'test-child',
|
||||
attachTo: extension.inputs.children,
|
||||
output: [coreExtensionData.reactElement],
|
||||
factory: () => [
|
||||
coreExtensionData.reactElement(<div>Its Me</div>),
|
||||
],
|
||||
}),
|
||||
],
|
||||
}),
|
||||
],
|
||||
config: {
|
||||
app: {
|
||||
extensions: [
|
||||
{
|
||||
'app-root-wrapper:test': { config: { name: 'Robin' } },
|
||||
'app-root-wrapper:app': { config: { name: 'Robin' } },
|
||||
},
|
||||
],
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user