Skip to content

Commit

Permalink
[EuiPanel] Add missing Emotion styles when panel render as button (
Browse files Browse the repository at this point in the history
…#6010)

* Add `Emotion`styles when panel render as `button`

* Adding CL
  • Loading branch information
elizabetdev authored Jun 29, 2022
1 parent afdc57b commit 465436a
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/components/panel/__snapshots__/panel.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[` 1`] = `
<button
aria-label="aria-label"
class="euiPanel euiPanel--plain euiPanel--paddingMedium testClass1 testClass2 emotion-euiPanel-grow-m-m-plain-hasShadow-isClickable"
data-test-subj="test subject string"
/>
`;

exports[`EuiPanel is rendered 1`] = `
<div
aria-label="aria-label"
Expand Down
8 changes: 8 additions & 0 deletions src/components/panel/panel.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,5 +81,13 @@ describe('EuiPanel', () => {
});
});
});

describe('onClick', () => {
const component = render(
<EuiPanel {...requiredProps} onClick={jest.fn()} />
);

expect(component).toMatchSnapshot();
});
});
});
1 change: 1 addition & 0 deletions src/components/panel/panel.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,7 @@ export const EuiPanel: FunctionComponent<EuiPanelProps> = ({
<button
ref={panelRef as Ref<HTMLButtonElement>}
className={classes}
css={cssStyles}
{...(rest as ButtonHTMLAttributes<HTMLButtonElement>)}
>
{children}
Expand Down
3 changes: 3 additions & 0 deletions upcoming_changelogs/6010.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
**Bug fixes**

Fixed issue with `EuiPanel` where the `Emotion` styles were not being passed when it was rendered as a button

0 comments on commit 465436a

Please sign in to comment.