frontend-*-api: test updates for extension ID change

Co-authored-by: Camila Belo <camilaibs@gmail.com>
Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-22 16:59:32 +01:00
parent 710260b849
commit c387f809d3
9 changed files with 233 additions and 185 deletions
@@ -24,11 +24,10 @@ import { createRouteRef } from '../routing';
import { createExtensionTester } from '@backstage/frontend-test-utils';
const wrapInBoundaryExtension = (element: JSX.Element) => {
const id = 'plugin.extension';
const routeRef = createRouteRef();
return createExtension({
id,
attachTo: { id: 'core.routes', input: 'routes' },
name: 'test',
attachTo: { id: 'core/routes', input: 'routes' },
output: {
element: coreExtensionData.reactElement,
path: coreExtensionData.routePath,
@@ -89,7 +88,7 @@ describe('ExtensionBoundary', () => {
action,
subject,
context: {
extension: 'plugin.extension',
extension: 'test',
routeRef: 'unknown',
},
}),
@@ -37,7 +37,21 @@ describe('createExtensionOverrides', () => {
createExtensionOverrides({
extensions: [
createExtension({
id: 'a',
name: 'a',
attachTo: { id: 'core', input: 'apis' },
output: {},
factory: () => ({}),
}),
createExtension({
namespace: 'b',
attachTo: { id: 'core', input: 'apis' },
output: {},
factory: () => ({}),
}),
createExtension({
kind: 'k',
namespace: 'c',
name: 'n',
attachTo: { id: 'core', input: 'apis' },
output: {},
factory: () => ({}),
@@ -54,12 +68,39 @@ describe('createExtensionOverrides', () => {
"id": "core",
"input": "apis",
},
"configSchema": undefined,
"disabled": false,
"factory": [Function],
"id": "a",
"inputs": {},
"output": {},
},
{
"$$type": "@backstage/Extension",
"attachTo": {
"id": "core",
"input": "apis",
},
"configSchema": undefined,
"disabled": false,
"factory": [Function],
"id": "b",
"inputs": {},
"output": {},
},
{
"$$type": "@backstage/Extension",
"attachTo": {
"id": "core",
"input": "apis",
},
"configSchema": undefined,
"disabled": false,
"factory": [Function],
"id": "k:c/n",
"inputs": {},
"output": {},
},
],
"featureFlags": [],
"version": "v1",
@@ -71,7 +112,7 @@ describe('createExtensionOverrides', () => {
const overrides = createExtensionOverrides({
extensions: [
createExtension({
id: 'a',
namespace: 'a',
attachTo: { id: 'core', input: 'apis' },
output: {},
factory: () => ({}),