Rename entity() to createEntity()
Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
@@ -26,7 +26,7 @@ import {
|
||||
} from '@backstage/core-components';
|
||||
import { airbrakeApiRef, MockAirbrakeApi } from '../src/api';
|
||||
import { EntityProvider } from '@backstage/plugin-catalog-react';
|
||||
import { entity } from '../src/api/mock/mock-entity';
|
||||
import { createEntity } from '../src/api/mock/mock-entity';
|
||||
|
||||
createDevApp()
|
||||
.registerPlugin(airbrakePlugin)
|
||||
@@ -51,7 +51,7 @@ createDevApp()
|
||||
A description of your plugin goes here.
|
||||
</SupportButton>
|
||||
</ContentHeader>
|
||||
<EntityProvider entity={entity('demo')}>
|
||||
<EntityProvider entity={createEntity('demo')}>
|
||||
<EntityAirbrakeContent />
|
||||
</EntityProvider>
|
||||
</Content>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
import { AIRBRAKE_PROJECT_SLUG_ANNOTATION } from '../../components/useProjectSlug';
|
||||
import { Entity } from '@backstage/catalog-model';
|
||||
|
||||
export const entity = (name?: string) =>
|
||||
export const createEntity = (name?: string) =>
|
||||
({
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Component',
|
||||
|
||||
@@ -18,12 +18,12 @@ import React from 'react';
|
||||
import { EntityAirbrakeWidget } from './EntityAirbrakeWidget';
|
||||
import exampleData from '../../api/mock/airbrake-groups-api-mock.json';
|
||||
import { renderInTestApp } from '@backstage/test-utils';
|
||||
import { entity } from '../../api/mock/mock-entity';
|
||||
import { createEntity } from '../../api/mock/mock-entity';
|
||||
|
||||
describe('EntityAirbrakeContent', () => {
|
||||
it('renders all errors sent from Airbrake', async () => {
|
||||
const table = await renderInTestApp(
|
||||
<EntityAirbrakeWidget entity={entity('test')} />,
|
||||
<EntityAirbrakeWidget entity={createEntity('test')} />,
|
||||
);
|
||||
expect(exampleData.groups.length).toBeGreaterThan(0);
|
||||
for (const group of exampleData.groups) {
|
||||
|
||||
Reference in New Issue
Block a user