Skip to content

Commit

Permalink
[EuiCodeBlockImpl] Handle data-test-subj in testenv mock (#3560)
Browse files Browse the repository at this point in the history
* handle data-test-subj in testenv mock

* CL
  • Loading branch information
thompsongl authored Jun 5, 2020
1 parent a0aa344 commit 75d59e2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
## [`master`](https://github.com/elastic/eui/tree/master)

No public interface changes since `25.0.0`.
**Bug fixes**

- Fixed `EuiCodeBlockImpl` testenv mock pass-through of `data-test-subj` attribute ([#3560](https://github.com/elastic/eui/pull/3560))

## [`25.0.0`](https://github.com/elastic/eui/tree/v25.0.0)

Expand Down
8 changes: 6 additions & 2 deletions src/components/code/_code_block.testenv.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,12 @@
*/

import React from 'react';
export const EuiCodeBlockImpl = ({ children, inline }: any) => {
const snippet = <code>{children}</code>;
export const EuiCodeBlockImpl = ({
children,
inline,
'data-test-subj': dataTestSubj,
}: any) => {
const snippet = <code data-test-subj={dataTestSubj}>{children}</code>;
return inline ? (
<span>{snippet}</span>
) : (
Expand Down

0 comments on commit 75d59e2

Please sign in to comment.