Created
November 7, 2018 19:52
-
-
Save kvendrik/b18d3d826c18c9a49699748e168100a8 to your computer and use it in GitHub Desktop.
Link tests: href 1
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
| import * as React from 'react'; | |
| import {mount} from 'enzyme'; | |
| import {UnstyledLink, Button} from '../components'; | |
| import Link from '../Link'; | |
| describe('<Link />', () => { | |
| const mockProps = { | |
| children: 'Click me!', | |
| }; | |
| describe('href', () => { | |
| it('renders an UnstyledLink when given', () => { | |
| const href = 'http://google.com'; | |
| const link = mount(<Link {...mockProps} href={href} />); | |
| expect(link.find(UnstyledLink).exists()).toBeTruthy(); | |
| }); | |
| it('renders a Button when not given', () => { | |
| const link = mount(<Link {...mockProps} />); | |
| expect(link.find(Button).exists()).toBeTruthy(); | |
| }); | |
| }); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment