fix: remove old views (#36677)

This commit is contained in:
Ahmad Abdolsaheb
2019-08-30 12:54:01 +03:00
committed by mrugesh
parent e9d753fc09
commit f8a603d182
25 changed files with 689 additions and 1462 deletions

View 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();
});
});