forked from elastic/eui
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Convert
EuiSwitch
to TS (elastic#2243)
* convert euiswitch to ts * remove test file * euiswitchevent; store id in state * change interface to type * CL
- Loading branch information
1 parent
1912146
commit dab3119
Showing
13 changed files
with
272 additions
and
319 deletions.
There are no files selected for viewing
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
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
81 changes: 0 additions & 81 deletions
81
src/components/form/switch/__snapshots__/switch.test.js.snap
This file was deleted.
Oops, something went wrong.
97 changes: 97 additions & 0 deletions
97
src/components/form/switch/__snapshots__/switch.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,97 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`EuiSwitch assigns automatically generated ID to label 1`] = ` | ||
<div | ||
class="euiSwitch" | ||
> | ||
<button | ||
aria-checked="false" | ||
class="euiSwitch__button" | ||
id="generated-id" | ||
role="switch" | ||
> | ||
<span | ||
class="euiSwitch__body" | ||
> | ||
<span | ||
class="euiSwitch__thumb" | ||
/> | ||
<span | ||
class="euiSwitch__track" | ||
> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon euiSwitch__icon--checked" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
</span> | ||
</span> | ||
</button> | ||
<label | ||
class="euiSwitch__label" | ||
for="generated-id" | ||
> | ||
Label | ||
</label> | ||
</div> | ||
`; | ||
|
||
exports[`EuiSwitch is rendered 1`] = ` | ||
<div | ||
class="euiSwitch testClass1 testClass2" | ||
> | ||
<button | ||
aria-checked="false" | ||
aria-label="aria-label" | ||
class="euiSwitch__button" | ||
data-test-subj="test subject string" | ||
id="test" | ||
role="switch" | ||
> | ||
<span | ||
class="euiSwitch__body" | ||
> | ||
<span | ||
class="euiSwitch__thumb" | ||
/> | ||
<span | ||
class="euiSwitch__track" | ||
> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
<svg | ||
class="euiIcon euiIcon--medium euiIcon-isLoading euiSwitch__icon euiSwitch__icon--checked" | ||
focusable="false" | ||
height="16" | ||
viewBox="0 0 16 16" | ||
width="16" | ||
xmlns="http://www.w3.org/2000/svg" | ||
/> | ||
</span> | ||
</span> | ||
</button> | ||
<label | ||
class="euiSwitch__label" | ||
for="test" | ||
> | ||
Label | ||
</label> | ||
</div> | ||
`; |
Oops, something went wrong.