Add some routes to the extensions test

Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
Karan Shah
2022-02-01 17:18:22 +00:00
parent d7db71bb2b
commit 499f8f547e
+14 -2
View File
@@ -15,11 +15,23 @@
*/
import React from 'react';
import { EntityAirbrakeContent } from './extensions';
import { renderInTestApp } from '@backstage/test-utils';
import { renderInTestApp, TestApiProvider } from '@backstage/test-utils';
import { airbrakeApiRef, MockAirbrakeApi } from './api';
import { rootRouteRef } from './routes';
describe('The Airbrake entity', () => {
it('should render the content properly', async () => {
const rendered = await renderInTestApp(<EntityAirbrakeContent />);
const rendered = await renderInTestApp(
<TestApiProvider apis={[[airbrakeApiRef, new MockAirbrakeApi()]]}>
<EntityAirbrakeContent />
</TestApiProvider>,
{
mountedRoutes: {
'/': rootRouteRef,
},
routeEntries: ['/'],
},
);
expect(rendered.getByText('ChunkLoadError')).toBeInTheDocument();
});
});