Tom Kirkpatrick
6 years ago
4 changed files with 45 additions and 0 deletions
@ -0,0 +1,16 @@ |
|||
import React from 'react' |
|||
import { Box } from 'rebass' |
|||
|
|||
/** |
|||
* @render react |
|||
* @name Bar |
|||
* @example |
|||
* <Bar /> |
|||
*/ |
|||
class Bar extends React.PureComponent { |
|||
render() { |
|||
return <Box width={1} bg="white" css={{ height: '1px' }} {...this.props} as="hr" /> |
|||
} |
|||
} |
|||
|
|||
export default Bar |
@ -0,0 +1,5 @@ |
|||
import React from 'react' |
|||
import { storiesOf } from '@storybook/react' |
|||
import Bar from 'components/UI/Bar' |
|||
|
|||
storiesOf('Components.Bar', module).add('bar', () => <Bar />) |
@ -0,0 +1,10 @@ |
|||
import React from 'react' |
|||
import Bar from 'components/UI/Bar' |
|||
import renderer from 'react-test-renderer' |
|||
|
|||
describe('component.UI.Bar', () => { |
|||
it('should render correctly', () => { |
|||
const tree = renderer.create(<Bar />).toJSON() |
|||
expect(tree).toMatchSnapshot() |
|||
}) |
|||
}) |
@ -0,0 +1,14 @@ |
|||
// Jest Snapshot v1, https://goo.gl/fbAQLP |
|||
|
|||
exports[`component.UI.Bar should render correctly 1`] = ` |
|||
.c0 { |
|||
width: 100%; |
|||
background-color: white; |
|||
height: 1px; |
|||
} |
|||
|
|||
<hr |
|||
className="c0" |
|||
width={1} |
|||
/> |
|||
`; |
Loading…
Reference in new issue