Makes SplunkOnCallCard comply with new IconLinkVertical APIs
This commit is contained in:
@@ -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 (
|
||||
|
||||
Reference in New Issue
Block a user