frontend-plugin-api: update ExtensionBoundary test + switch to extensionId

Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com>
This commit is contained in:
Patrik Oldsberg
2023-11-28 13:59:49 +01:00
parent a68ee8561f
commit 4fb69fdaf6
2 changed files with 10 additions and 7 deletions
@@ -83,15 +83,18 @@ describe('ExtensionBoundary', () => {
),
).render();
await waitFor(() =>
expect(analyticsApiMock.getEvents()[0]).toMatchObject({
await waitFor(() => {
const event = analyticsApiMock
.getEvents()
.find(e => e.subject === subject);
expect(event).toMatchObject({
action,
subject,
context: {
extension: 'test',
routeRef: 'unknown',
extensionId: 'test',
},
}),
);
});
});
});
});
@@ -59,7 +59,7 @@ export function ExtensionBoundary(props: ExtensionBoundaryProps) {
// Skipping "routeRef" attribute in the new system, the extension "id" should provide more insight
const attributes = {
extension: node.spec.id,
extensionId: node.spec.id,
pluginId: node.spec.source?.id,
};