-
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.
config babel to support typescript, add a snapshot test code for the …
…button component
- Loading branch information
Showing
5 changed files
with
871 additions
and
16 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
module.exports = { | ||
presets: [ | ||
['@babel/preset-env', {targets: {node: 'current'}}], | ||
['@babel/preset-react', {runtime: 'automatic'}], | ||
'@babel/preset-typescript', | ||
], | ||
}; |
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,9 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`changes the class when hovered 1`] = ` | ||
<button | ||
className="sc-dkrFOg sc-eDvSVe bAenDU iJPJvM" | ||
> | ||
Test | ||
</button> | ||
`; |
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,11 @@ | ||
import renderer from 'react-test-renderer'; | ||
import Button, { BUTTON_TYPES } from './button.component'; | ||
|
||
it('changes the class when hovered', () => { | ||
const component = renderer.create( | ||
<Button buttonType={BUTTON_TYPES.inverted}>Test</Button>, | ||
); | ||
let tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
} | ||
); |
Oops, something went wrong.