test when no Splunk On Call annotations are provided
Signed-off-by: Mike Ball <mikedball@gmail.com>
This commit is contained in:
@@ -84,6 +84,15 @@ const mockEntityWithRoutingKeyAnnotation = {
|
||||
},
|
||||
} as Entity;
|
||||
|
||||
const mockEntityNoAnnotation = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Component',
|
||||
metadata: {
|
||||
name: 'splunkoncall-test',
|
||||
annotations: {},
|
||||
},
|
||||
} as Entity;
|
||||
|
||||
const mockEntityNoIncidents = {
|
||||
apiVersion: 'backstage.io/v1alpha1',
|
||||
kind: 'Component',
|
||||
@@ -164,6 +173,20 @@ describe('SplunkOnCallCard', () => {
|
||||
).toBeInTheDocument();
|
||||
});
|
||||
|
||||
it('handles warning for missing required annotations', async () => {
|
||||
const { getAllByText, queryByTestId } = render(
|
||||
wrapInTestApp(
|
||||
<ApiProvider apis={apis}>
|
||||
<EntityProvider entity={mockEntityNoAnnotation}>
|
||||
<EntitySplunkOnCallCard />
|
||||
</EntityProvider>
|
||||
</ApiProvider>,
|
||||
),
|
||||
);
|
||||
await waitFor(() => !queryByTestId('progress'));
|
||||
expect(getAllByText('Missing Annotation').length).toEqual(2);
|
||||
});
|
||||
|
||||
it('handles warning for incorrect team annotation', async () => {
|
||||
mockSplunkOnCallApi.getUsers = jest
|
||||
.fn()
|
||||
|
||||
Reference in New Issue
Block a user