Added a test for the annotation missing component
Signed-off-by: Karan Shah <karan.shah@simplybusiness.co.uk>
This commit is contained in:
@@ -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();
|
||||
});
|
||||
});
|
||||
|
||||
@@ -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);
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user