@@ -17,6 +17,7 @@
|
||||
import {
|
||||
ApiBlueprint,
|
||||
createExtensionInput,
|
||||
createFrontendModule,
|
||||
createSwappableComponent,
|
||||
SwappableComponentBlueprint,
|
||||
swappableComponentsApiRef,
|
||||
@@ -202,7 +203,13 @@ describe('DefaultSwappableComponentsApi', () => {
|
||||
});
|
||||
|
||||
renderInTestApp(<MockComponent />, {
|
||||
extensions: [api, override],
|
||||
extensions: [api],
|
||||
features: [
|
||||
createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [override],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
await expect(
|
||||
@@ -225,7 +232,13 @@ describe('DefaultSwappableComponentsApi', () => {
|
||||
});
|
||||
|
||||
renderInTestApp(<MockComponent />, {
|
||||
extensions: [api, override],
|
||||
extensions: [api],
|
||||
features: [
|
||||
createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [override],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
await expect(
|
||||
@@ -252,7 +265,13 @@ describe('DefaultSwappableComponentsApi', () => {
|
||||
});
|
||||
|
||||
renderInTestApp(<MockComponent external="test" />, {
|
||||
extensions: [api, override],
|
||||
extensions: [api],
|
||||
features: [
|
||||
createFrontendModule({
|
||||
pluginId: 'app',
|
||||
extensions: [override],
|
||||
}),
|
||||
],
|
||||
});
|
||||
|
||||
await expect(
|
||||
|
||||
@@ -45,9 +45,7 @@ export const SwappableComponentsApi = ApiBlueprint.makeWithOverrides({
|
||||
if (nonAppExtensions.length > 0) {
|
||||
// eslint-disable-next-line no-console
|
||||
console.warn(
|
||||
`SwappableComponents should only be installed as an extension in the app plugin.
|
||||
You can either use appPlugin.override(), or provide a module for the app-plugin with the extension there instead.
|
||||
Invalid extensions: ${nonAppExtensions
|
||||
`SwappableComponents should only be installed as an extension in the app plugin. You can either use appPlugin.override(), or provide a module for the app-plugin with the extension there instead. Invalid extensions: ${nonAppExtensions
|
||||
.map(i => i.node.spec.id)
|
||||
.join(', ')}`,
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user