-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use enzyme to json instead of react-test-renderer, also fix tests and…
… snapshots
- Loading branch information
Showing
51 changed files
with
1,262 additions
and
2,168 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,6 @@ | ||
import Enzyme from 'enzyme' | ||
import Adapter from 'enzyme-adapter-react-16' | ||
import { createSerializer } from 'enzyme-to-json' | ||
|
||
Enzyme.configure({ adapter: new Adapter() }) | ||
expect.addSnapshotSerializer(createSerializer({ mode: 'deep' })) |
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
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 |
---|---|---|
@@ -1,11 +1,10 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import { mount } from 'enzyme' | ||
|
||
import AddButton from './' | ||
|
||
it('renders correctly', () => { | ||
const tree = renderer | ||
.create(<AddButton handleClick={() => {}} />) | ||
.toJSON() | ||
const tree = mount(<AddButton onClick={() => {}} />) | ||
|
||
expect(tree).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 |
---|---|---|
@@ -1,17 +1,16 @@ | ||
import React from 'react' | ||
import renderer from 'react-test-renderer' | ||
import { mount } from 'enzyme' | ||
|
||
import AppContainer from './' | ||
|
||
describe('Component Info', () => { | ||
it('renders correctly', () => { | ||
const tree = renderer | ||
.create(( | ||
<AppContainer> | ||
Foo | ||
</AppContainer> | ||
)) | ||
.toJSON() | ||
const tree = mount(( | ||
<AppContainer> | ||
Foo | ||
</AppContainer> | ||
)) | ||
|
||
expect(tree).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
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
Oops, something went wrong.