Makes SplunkOnCallCard comply with new IconLinkVertical APIs

This commit is contained in:
Juan Lulkin
2021-02-25 13:37:02 +01:00
parent da2283b357
commit 1a074cfe5e
3 changed files with 10 additions and 13 deletions
@@ -35,6 +35,9 @@ const useIconStyles = makeStyles(theme => ({
justifyItems: 'center',
gridGap: 4,
textAlign: 'center',
'&:active': {
cursor: 'grabbing',
},
},
disabled: {
color: 'gray',
@@ -132,6 +132,7 @@ describe('SplunkOnCallCard', () => {
),
).toBeInTheDocument();
});
it('opens the dialog when trigger button is clicked', async () => {
mockSplunkOnCallApi.getUsers = jest
.fn()
@@ -146,7 +147,7 @@ describe('SplunkOnCallCard', () => {
);
await waitFor(() => !queryByTestId('progress'));
expect(getByText('Create Incident')).toBeInTheDocument();
const triggerButton = getByTestId('trigger-button');
const triggerButton = getByText('Create Incident');
await act(async () => {
fireEvent.click(triggerButton);
});
@@ -21,6 +21,7 @@ import {
MissingAnnotationEmptyState,
configApiRef,
EmptyState,
IconLinkVerticalProps,
} from '@backstage/core';
import { Entity } from '@backstage/catalog-model';
import {
@@ -159,19 +160,11 @@ export const SplunkOnCallCard = ({ entity }: Props) => {
);
};
const triggerLink = {
const triggerLink: IconLinkVerticalProps = {
label: 'Create Incident',
action: (
<Button
data-testid="trigger-button"
color="secondary"
onClick={handleDialog}
className={classes.triggerAlarm}
>
Create Incident
</Button>
),
icon: <AlarmAddIcon onClick={handleDialog} />,
onClick: handleDialog,
color: 'secondary',
icon: <AlarmAddIcon />,
};
return (