fix: remove old views (#36677)
This commit is contained in:
committed by
mrugesh
parent
e9d753fc09
commit
f8a603d182
25
client/src/components/helpers/Link.test.js
Normal file
25
client/src/components/helpers/Link.test.js
Normal file
@@ -0,0 +1,25 @@
|
||||
/* global expect */
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import 'jest-dom/extend-expect';
|
||||
|
||||
import Link from './Link';
|
||||
|
||||
describe('<Link />', () => {
|
||||
const externalLink = renderer
|
||||
.create(<Link external={true} to='/home' />)
|
||||
.toJSON();
|
||||
const gatsbyLink = renderer.create(<Link to='/home' />).toJSON();
|
||||
|
||||
it('renders to the DOM', () => {
|
||||
expect(gatsbyLink).toBeTruthy();
|
||||
});
|
||||
|
||||
it('sets target for external links', () => {
|
||||
expect(externalLink.props.target).toEqual('_blank');
|
||||
});
|
||||
|
||||
it('does not specify target in gatsbyLink', () => {
|
||||
expect(gatsbyLink.props.target).toBeFalsy();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user