-
-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathlinkButton.spec.js
More file actions
27 lines (25 loc) · 895 Bytes
/
linkButton.spec.js
File metadata and controls
27 lines (25 loc) · 895 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
import React from 'react';
import { mount } from 'enzyme';
import { Link } from 'react-router-dom';
import RainbowFirebaseApp from '../../../../../app/src/components/App';
import LinkButton from '..';
describe('<LinkButton />', () => {
it('should render a Link when target is not `_blank`', () => {
const component = mount(
<RainbowFirebaseApp>
<LinkButton to="">Test</LinkButton>
</RainbowFirebaseApp>,
);
expect(component.find(Link).exists()).toBe(true);
});
it('should render a regular anchor when target is `_blank`', () => {
const component = mount(
<RainbowFirebaseApp>
<LinkButton to="" target="_blank">
Test
</LinkButton>
</RainbowFirebaseApp>,
);
expect(component.find('a').exists()).toBe(true);
});
});