Skip to content

Commit

Permalink
Replace text button with icon button for blocked windows
Browse files Browse the repository at this point in the history
  • Loading branch information
scottybollinger committed Oct 14, 2021
1 parent 3f8273e commit 3282361
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ import { shallow } from 'enzyme';
import moment from 'moment';

import {
EuiButton,
EuiButtonIcon,
EuiDatePicker,
EuiDatePickerRange,
EuiSelect,
Expand Down Expand Up @@ -53,7 +53,7 @@ describe('BlockedWindowItem', () => {

it('handles remove button click', () => {
const wrapper = shallow(<BlockedWindowItem {...props} />);
wrapper.find(EuiButton).simulate('click');
wrapper.find(EuiButtonIcon).simulate('click');

expect(removeBlockedWindow).toHaveBeenCalledWith(0);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { useActions, useValues } from 'kea';
import moment from 'moment';

import {
EuiButton,
EuiButtonIcon,
EuiDatePicker,
EuiDatePickerRange,
EuiFlexGroup,
Expand Down Expand Up @@ -179,9 +179,14 @@ export const BlockedWindowItem: React.FC<Props> = ({ blockedWindow, index }) =>
/>
</EuiFlexItem>
<EuiFlexItem grow={false}>
<EuiButton fill color="danger" onClick={() => removeBlockedWindow(index)}>
{REMOVE_BUTTON}
</EuiButton>
<EuiButtonIcon
display="base"
iconType="trash"
color="danger"
onClick={() => removeBlockedWindow(index)}
aria-label={REMOVE_BUTTON}
title={REMOVE_BUTTON}
/>
</EuiFlexItem>
</EuiFlexGroup>
<EuiSpacer size="s" />
Expand Down

0 comments on commit 3282361

Please sign in to comment.