chore: restructure tests and fix api-report
Signed-off-by: blam <ben@blam.sh>
This commit is contained in:
@@ -356,6 +356,10 @@ export interface BackstagePlugin<
|
||||
readonly id: string;
|
||||
// (undocumented)
|
||||
readonly routes: TRoutes;
|
||||
// (undocumented)
|
||||
withOverrides(options: {
|
||||
extensions: Array<ExtensionDefinition<any, any>>;
|
||||
}): BackstagePlugin<TRoutes, TExternalRoutes, TExtensionMap>;
|
||||
}
|
||||
|
||||
export { BackstageUserIdentity };
|
||||
|
||||
@@ -273,16 +273,42 @@ describe('createPlugin', () => {
|
||||
});
|
||||
|
||||
describe('overrides', () => {
|
||||
it('should return a plugin instance with the correct namespace', () => {
|
||||
const plugin = createPlugin({
|
||||
id: 'test',
|
||||
extensions: [Extension1, Extension2],
|
||||
});
|
||||
|
||||
expect(plugin.getExtension('test/1')).toMatchInlineSnapshot(`
|
||||
{
|
||||
"$$type": "@backstage/ExtensionDefinition",
|
||||
"attachTo": {
|
||||
"id": "test/output",
|
||||
"input": "names",
|
||||
},
|
||||
"configSchema": undefined,
|
||||
"disabled": false,
|
||||
"factory": [Function],
|
||||
"inputs": {},
|
||||
"kind": undefined,
|
||||
"name": "1",
|
||||
"namespace": "test",
|
||||
"output": [
|
||||
[Function],
|
||||
],
|
||||
"override": [Function],
|
||||
"toString": [Function],
|
||||
"version": "v2",
|
||||
}
|
||||
`);
|
||||
});
|
||||
|
||||
it('should allow overriding extensions that have a matching ID, while keeping old extensions that do not have overlapping IDs', async () => {
|
||||
const plugin = createPlugin({
|
||||
id: 'test',
|
||||
extensions: [Extension1, Extension2, outputExtension],
|
||||
});
|
||||
|
||||
expect(plugin.getExtension('test/1')).toMatchObject({
|
||||
namespace: 'test',
|
||||
});
|
||||
|
||||
await renderWithEffects(
|
||||
createTestAppRoot({
|
||||
features: [
|
||||
|
||||
Reference in New Issue
Block a user