This file contains hidden or 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
| $ yarn test | |
| FAIL lib/blocks/Button/__tests__/index.js | |
| Button Block | |
| ✕ renders correctly (18ms) | |
| ● Button Block › renders correctly | |
| expect(value).toMatchSnapshot() |
This file contains hidden or 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
| // lib/elements/Icon/__tests__/index.js | |
| import React from 'react'; | |
| import Icon from '../index'; | |
| import 'jest-styled-components'; | |
| import renderer from 'react-test-renderer'; | |
| describe('Icon Element', () => { | |
| it('renders correctly', () => { | |
| const tree = renderer.create( |
This file contains hidden or 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
| // lib/elements/Icon/index.js | |
| import React from 'react'; | |
| import PropTypes from 'prop-types'; | |
| import styled from 'styled-components'; | |
| import FontAwesome from 'react-fontawesome'; | |
| import { omit } from 'lodash'; | |
| function UnstyledIcon(props) { | |
| const iconProps = omit(props, ['modifiers']); |
This file contains hidden or 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
| ... | |
| const Icon = styled(FontAwesome)` | |
| font-size: 1rem; | |
| `; | |
| ... |
This file contains hidden or 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
| // lib/blocks/Button/__tests__/index.js | |
| import React from 'react'; | |
| import Button from '../index'; | |
| import renderer from 'react-test-renderer'; | |
| import 'jest-styled-components'; |
This file contains hidden or 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
| $ yarn test | |
| FAIL lib/blocks/Button/__tests__/index.js | |
| Button Block | |
| ✕ renders correctly (24ms) | |
| ● Button Block › renders correctly | |
| expect(value).toMatchSnapshot() |