Added a test for the annotation missing component

Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
Karan Shah
2022-02-04 14:06:18 +00:00
parent f7ad6f0795
commit e8731ffbc6
2 changed files with 19 additions and 0 deletions
@@ -35,4 +35,16 @@ describe('EntityAirbrakeContent', () => {
).toBeInTheDocument();
}
});
it('states that the annotation is missing if no annotation is provided', async () => {
const table = await renderInTestApp(
<TestApiProvider apis={[[airbrakeApiRef, new MockAirbrakeApi()]]}>
<EntityAirbrakeWidget entity={createEntity()} />
</TestApiProvider>,
);
expect(exampleData.groups.length).toBeGreaterThan(0);
await expect(
table.findByText('Missing Annotation'),
).resolves.toBeInTheDocument();
});
});
+7
View File
@@ -15,9 +15,16 @@
*/
import { airbrakePlugin } from './plugin';
import { ProductionAirbrakeApi } from './api';
describe('catalog', () => {
it('should export plugin', () => {
expect(airbrakePlugin).toBeDefined();
});
it('should have at least one API, the production API', () => {
const apiFactories = Array.from(airbrakePlugin.getApis());
expect(apiFactories.length).toBe(1);
expect(apiFactories[0].factory({})).toBeInstanceOf(ProductionAirbrakeApi);
});
});