-
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.
- Loading branch information
Showing
6 changed files
with
91 additions
and
15 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,14 @@ | ||
import React from 'react'; | ||
import styled from 'styled-components'; | ||
|
||
const ImageContainer = styled.div` | ||
text-align: center; | ||
`; | ||
|
||
const ZeroState = () => ( | ||
<ImageContainer> | ||
<p>Zero State</p> | ||
</ImageContainer> | ||
); | ||
|
||
export default ZeroState; |
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,35 @@ | ||
import React from 'react'; | ||
import { shallow, configure } from 'enzyme'; | ||
import Adapter from 'enzyme-adapter-react-16'; | ||
import renderer from 'react-test-renderer'; | ||
import ZeroState from './ZeroState'; | ||
|
||
configure({ adapter: new Adapter() }); | ||
|
||
describe('ZeroState', () => { | ||
let wrapper; | ||
|
||
beforeEach(() => { | ||
wrapper = shallow(<ZeroState />); | ||
}); | ||
|
||
describe('rendering', () => { | ||
describe('initial state', () => { | ||
it('is rendered', () => { | ||
const component = renderer.create(<ZeroState />); | ||
const tree = component.toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('is rendered correctly', () => { | ||
expect(wrapper).toHaveLength(1); | ||
}); | ||
|
||
it('should have correct inital instance', () => { | ||
const initialInstance = wrapper.instance(); | ||
const expectedInstance = null; | ||
expect(initialInstance).toBe(expectedInstance); | ||
}); | ||
}); | ||
}); | ||
}); |
11 changes: 11 additions & 0 deletions
11
app/components/shared/ZeroState/__snapshots__/ZeroState.spec.js.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,11 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`ZeroState rendering initial state is rendered 1`] = ` | ||
<div | ||
className="sc-bdVaJa khUSez" | ||
> | ||
<p> | ||
Zero State | ||
</p> | ||
</div> | ||
`; |
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