review comments

Signed-off-by: Fredrik Adelöw <freben@gmail.com>
This commit is contained in:
Fredrik Adelöw
2024-01-12 21:58:38 +01:00
parent c97fa1c2bd
commit 26d0110678
3 changed files with 10 additions and 12 deletions
@@ -54,14 +54,12 @@ export const AppRoot = createExtension({
{ element: coreExtensionData.reactElement },
{ singleton: true },
),
elements: createExtensionInput(
{ element: coreExtensionData.reactElement },
{ optional: true },
),
wrappers: createExtensionInput(
{ component: createAppRootWrapperExtension.componentDataRef },
{ optional: true },
),
elements: createExtensionInput({
element: coreExtensionData.reactElement,
}),
wrappers: createExtensionInput({
component: createAppRootWrapperExtension.componentDataRef,
}),
},
output: {
element: coreExtensionData.reactElement,
@@ -33,7 +33,7 @@ describe('createAppRootWrapperExtension', () => {
expect(extension).toEqual({
$$type: '@backstage/ExtensionDefinition',
version: 'v1',
kind: 'app-wrapper-component',
kind: 'app-root-wrapper',
attachTo: { id: 'app/root', input: 'wrappers' },
disabled: false,
inputs: {},
@@ -79,7 +79,7 @@ describe('createAppRootWrapperExtension', () => {
expect(extension).toEqual({
$$type: '@backstage/ExtensionDefinition',
version: 'v1',
kind: 'app-wrapper-component',
kind: 'app-root-wrapper',
namespace: 'ns',
name: 'test',
attachTo: { id: 'app/root', input: 'wrappers' },
@@ -106,7 +106,7 @@ describe('createAppRootWrapperExtension', () => {
.add(extension, { config: { name: 'Robin' } })
.add(
createExtension({
attachTo: { id: 'app-wrapper-component:ns/test', input: 'children' },
attachTo: { id: 'app-root-wrapper:ns/test', input: 'children' },
output: { element: coreExtensionData.reactElement },
factory: () => ({ element: <div /> }),
}),
@@ -50,7 +50,7 @@ export function createAppRootWrapperExtension<
>;
}): ExtensionDefinition<TConfig> {
return createExtension({
kind: 'app-wrapper-component',
kind: 'app-root-wrapper',
namespace: options.namespace,
name: options.name,
attachTo: options.attachTo ?? { id: 'app/root', input: 'wrappers' },