diff --git a/packages/core-app-api/src/routing/collectors.beta.test.tsx b/packages/core-app-api/src/routing/collectors.beta.test.tsx index 74d8bbbe53..057674a7e4 100644 --- a/packages/core-app-api/src/routing/collectors.beta.test.tsx +++ b/packages/core-app-api/src/routing/collectors.beta.test.tsx @@ -112,16 +112,17 @@ function routeObj( caseSensitive: false, element: type, routeRefs: new Set(refs), + plugins: backstagePlugin ? new Set([backstagePlugin]) : new Set(), children: [ { path: '*', caseSensitive: false, element: 'match-all', routeRefs: new Set(), + plugins: new Set(), }, ...children, ], - plugin: backstagePlugin, }; } diff --git a/packages/core-app-api/src/routing/collectors.compat.test.tsx b/packages/core-app-api/src/routing/collectors.compat.test.tsx index e1333a070a..5dab06d03e 100644 --- a/packages/core-app-api/src/routing/collectors.compat.test.tsx +++ b/packages/core-app-api/src/routing/collectors.compat.test.tsx @@ -129,12 +129,14 @@ describe.each(['beta', 'stable'])('react-router %s', rrVersion => { caseSensitive: false, element: type, routeRefs: new Set(refs), + plugins: new Set(), children: [ { path: '*', caseSensitive: false, element: 'match-all', routeRefs: new Set(), + plugins: new Set(), }, ...children, ], diff --git a/packages/core-app-api/src/routing/collectors.stable.test.tsx b/packages/core-app-api/src/routing/collectors.stable.test.tsx index de6f350cc9..20c7643b9e 100644 --- a/packages/core-app-api/src/routing/collectors.stable.test.tsx +++ b/packages/core-app-api/src/routing/collectors.stable.test.tsx @@ -118,10 +118,11 @@ function routeObj( caseSensitive: false, element: 'match-all', routeRefs: new Set(), + plugins: new Set(), }, ...children, ], - plugin: backstagePlugin, + plugins: backstagePlugin ? new Set([backstagePlugin]) : new Set(), }; } @@ -333,11 +334,11 @@ describe('discovery', () => { [ref5, ref3], ]); expect(routing.objects).toEqual([ - routeObj('foo', [ref1, ref2], [], 'gathered'), + routeObj('foo', [ref1, ref2], [], 'gathered', plugin), routeObj( 'bar', [ref3], - [routeObj('', [ref4, ref5], [], 'gathered')], + [routeObj('', [ref4, ref5], [], 'gathered', plugin)], undefined, plugin, ), @@ -403,6 +404,7 @@ describe('discovery', () => { ), ], 'gathered', + plugin, ), ], undefined, diff --git a/packages/core-app-api/src/routing/collectors.tsx b/packages/core-app-api/src/routing/collectors.tsx index c67e380c51..23f05fe62a 100644 --- a/packages/core-app-api/src/routing/collectors.tsx +++ b/packages/core-app-api/src/routing/collectors.tsx @@ -144,7 +144,6 @@ export const routingV2Collector = createCollector( caseSensitive: Boolean(node.props?.caseSensitive), children: [MATCH_ALL_ROUTE], plugins: new Set(), - plugin: undefined, }; parentChildren.push(newObj); @@ -175,7 +174,6 @@ export const routingV2Collector = createCollector( caseSensitive: Boolean(node.props?.caseSensitive), children: [MATCH_ALL_ROUTE], plugins: pluginSet(plugin), - plugin, }; parentChildren.push(newObj); acc.paths.set(routeRef, path);