Fix EntityAirbrakeWidget.test.tsx

Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
Karan Shah
2022-02-04 11:59:40 +00:00
parent d2434bada1
commit f7ad6f0795
@@ -17,13 +17,16 @@
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 { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { createEntity } from '../../api/mock/mock-entity';
import { airbrakeApiRef, MockAirbrakeApi } from '../../api';
describe('EntityAirbrakeContent', () => {
it('renders all errors sent from Airbrake', async () => {
const table = await renderInTestApp(
<EntityAirbrakeWidget entity={createEntity(123)} />,
<TestApiProvider apis={[[airbrakeApiRef, new MockAirbrakeApi()]]}>
<EntityAirbrakeWidget entity={createEntity(123)} />
</TestApiProvider>,
);
expect(exampleData.groups.length).toBeGreaterThan(0);
for (const group of exampleData.groups) {