chore: refactor tests to fix

Signed-off-by: benjdlambert <ben@blam.sh>
This commit is contained in:
benjdlambert
2025-08-11 09:38:33 +02:00
parent 4be2c4d61d
commit 2704359148
2 changed files with 23 additions and 6 deletions
@@ -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(', ')}`,
);