Skip to content

Commit

Permalink
change onDismissible to onDismiss (#1003) (#1008)
Browse files Browse the repository at this point in the history
(cherry picked from commit 38a6ea7)

Signed-off-by: abbyhu2000 <[email protected]>
Signed-off-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
  • Loading branch information
1 parent 8832ae9 commit 5525ecd
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion src-docs/src/views/call_out/info.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ export default () => {
title="Callouts can be dismissed when dismissible is set to true unless the color is danger or warning. "
iconType="wrench"
dismissible
onDismissible={closeCallOut}
onDismiss={closeCallOut}
/>
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ exports[`OuiCallOut props color warning is rendered 1`] = `
exports[`OuiCallOut props dismissible close callout after click 1`] = `
<OuiCallOut
dismissible={true}
onDismissible={[MockFunction]}
onDismiss={[MockFunction]}
title="This is a callout"
>
<div
Expand Down
6 changes: 3 additions & 3 deletions src/components/call_out/call_out.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -107,17 +107,17 @@ describe('OuiCallOut', () => {
});

it('close callout after click', () => {
const onDismissible = jest.fn();
const onDismiss = jest.fn();
const component = mount(
<OuiCallOut
dismissible={true}
onDismissible={onDismissible}
onDismiss={onDismiss}
title="This is a callout"
/>
);
expect(component).toMatchSnapshot();
findTestSubject(component, 'closeCallOutButton').simulate('click');
expect(onDismissible).toBeCalled();
expect(onDismiss).toBeCalled();
});
});
});
Expand Down
6 changes: 3 additions & 3 deletions src/components/call_out/call_out.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ export type OuiCallOutProps = CommonProps &
size?: Size;
heading?: Heading;
dismissible?: boolean;
onDismissible?: (
onDismiss?: (
event?:
| React.KeyboardEvent<HTMLDivElement>
| React.MouseEvent<HTMLButtonElement>
Expand Down Expand Up @@ -83,7 +83,7 @@ export const OuiCallOut = forwardRef<HTMLDivElement, OuiCallOutProps>(
className,
heading,
dismissible = false,
onDismissible = () => {},
onDismiss = () => {},
...rest
},
ref: Ref<HTMLDivElement>
Expand Down Expand Up @@ -114,7 +114,7 @@ export const OuiCallOut = forwardRef<HTMLDivElement, OuiCallOutProps>(
dismissibleIcon = (
<OuiButtonIcon
iconType="cross"
onClick={onDismissible}
onClick={onDismiss}
className="ouiCallOut__closeIcon"
aria-label="dismissible_icon"
data-test-subj="closeCallOutButton"
Expand Down

0 comments on commit 5525ecd

Please sign in to comment.