-
Notifications
You must be signed in to change notification settings - Fork 842
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
EuiFormControlLayoutClearButton
converted to TS
- Loading branch information
Theo
committed
May 7, 2019
1 parent
d332537
commit 295ce3d
Showing
5 changed files
with
60 additions
and
17 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
...nts/form/form_control_layout/__snapshots__/form_control_layout_clear_button.test.tsx.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiFormControlLayoutClearButton is rendered 1`] = ` | ||
<button | ||
aria-label="Clear input" | ||
class="euiFormControlLayoutClearButton customClass" | ||
data-test-subj="clearButton" | ||
type="button" | ||
> | ||
<svg | ||
class="euiIcon euiIcon--medium euiFormControlLayoutClearButton__icon" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
> | ||
<path | ||
d="M7.293 8L3.146 3.854a.5.5 0 1 1 .708-.708L8 7.293l4.146-4.147a.5.5 0 0 1 .708.708L8.707 8l4.147 4.146a.5.5 0 0 1-.708.708L8 8.707l-4.146 4.147a.5.5 0 0 1-.708-.708L7.293 8z" | ||
/> | ||
</svg> | ||
</button> | ||
`; |
16 changes: 16 additions & 0 deletions
16
src/components/form/form_control_layout/form_control_layout_clear_button.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
import React from 'react'; | ||
import { render } from 'enzyme'; | ||
import { EuiFormControlLayoutClearButton } from './form_control_layout_clear_button'; | ||
|
||
describe('EuiFormControlLayoutClearButton', () => { | ||
test('is rendered', () => { | ||
const clear = { | ||
onClick: () => null, | ||
className: 'customClass', | ||
'data-test-subj': 'clearButton', | ||
}; | ||
const component = render(<EuiFormControlLayoutClearButton {...clear} />); | ||
|
||
expect(component).toMatchSnapshot(); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
import { EuiFormControlLayoutClearButton as FormControlLayoutClearButton } from './form_control_layout_clear_button'; | ||
|
||
declare module '@elastic/eui' { | ||
/** | ||
* @see './form_control_layout_clear_button.js' | ||
*/ | ||
export const EuiFormControlLayoutClearButton: typeof FormControlLayoutClearButton; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters