diff --git a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx index 8b58af8e46..05d9a071c3 100644 --- a/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx +++ b/plugins/splunk-on-call/src/components/EntitySplunkOnCallCard.test.tsx @@ -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( + + + + + , + ), + ); + await waitFor(() => !queryByTestId('progress')); + expect(getAllByText('Missing Annotation').length).toEqual(2); + }); + it('handles warning for incorrect team annotation', async () => { mockSplunkOnCallApi.getUsers = jest .fn()