Skip to content

Commit

Permalink
Added container component
Browse files Browse the repository at this point in the history
  • Loading branch information
matheusps committed Apr 5, 2019
1 parent 30ec903 commit c4aa630
Show file tree
Hide file tree
Showing 5 changed files with 1,463 additions and 45 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"codecov": "^3.3.0",
"html-webpack-plugin": "^3.2.0",
"jest": "^24.7.1",
"react-styleguidist": "^9.0.5",
"react-testing-library": "^6.1.1",
"ts-jest": "^24.0.1",
"typescript": "^3.4.1",
Expand Down
15 changes: 15 additions & 0 deletions src/__tests__/Container.test.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import React from 'react'
import { render } from 'react-testing-library'
import Container from '../components/Container'

describe('Container component', () => {
it('should render', () => {
const component = render(<Container />)
expect(component).toBeTruthy()
})

it('shoult match snapshot', () => {
const component = render(<Container />)
expect(component.asFragment()).toMatchSnapshot()
})
})
9 changes: 9 additions & 0 deletions src/__tests__/__snapshots__/Container.test.tsx.snap
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`Container component shoult match snapshot 1`] = `
<DocumentFragment>
<div
style="background-color: rgb(206, 206, 206); padding: 1rem;"
/>
</DocumentFragment>
`;
13 changes: 13 additions & 0 deletions src/components/Container.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import React, { FunctionComponent } from 'react'

interface ContainerProps {}

const Container: FunctionComponent<ContainerProps> = ({ children }) => {
return (
<div style={{ backgroundColor: '#cecece', padding: '1rem' }}>
{children}
</div>
)
}

export default Container
Loading

0 comments on commit c4aa630

Please sign in to comment.