Removing unused PageTemplate component

This commit is contained in:
Jeff Avallone 2018-02-13 17:26:32 -05:00
parent 24062d978a
commit 44a9cad9b3
3 changed files with 0 additions and 146 deletions

View File

@ -1,74 +0,0 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP
exports[`PageTemplate rendering 1`] = `
<html>
<head>
<meta
charSet="utf-8"
/>
<meta
content="width=device-width, initial-scale=1, shrink-to-fit=no"
name="viewport"
/>
<meta
content="Regular expression visualization tool using railroad diagrams"
name="description"
/>
<link
href="/humans.txt"
rel="author"
/>
<title>
Regexper
</title>
</head>
<body
data-build-id="test-id"
>
<div
id="root"
>
<p>
Content
</p>
</div>
</body>
</html>
`;
exports[`PageTemplate rendering with title 1`] = `
<html>
<head>
<meta
charSet="utf-8"
/>
<meta
content="width=device-width, initial-scale=1, shrink-to-fit=no"
name="viewport"
/>
<meta
content="Regular expression visualization tool using railroad diagrams"
name="description"
/>
<link
href="/humans.txt"
rel="author"
/>
<title>
Regexper
- Example
</title>
</head>
<body
data-build-id="test-id"
>
<div
id="root"
>
<p>
Content
</p>
</div>
</body>
</html>
`;

View File

@ -1,37 +0,0 @@
import React from 'react';
import ReactDOMServer from 'react-dom/server';
import PropTypes from 'prop-types';
import pkg from '../../../package.json';
const PageTemplate = ({ title, children }) => (
<html>
<head>
<meta charSet="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="description" content={ pkg.description } />
<link rel="author" href="/humans.txt" />
<title>Regexper{ title && (' - ' + title) }</title>
</head>
<body data-build-id={ process.env.BUILD_ID }>
<div id="root">
{ children }
</div>
</body>
</html>
);
PageTemplate.propTypes = {
title: PropTypes.string,
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.node),
PropTypes.node
])
};
const renderToString = content => '<!DOCTYPE html>' + ReactDOMServer.renderToString(content);
export default PageTemplate;
export { renderToString };

View File

@ -1,35 +0,0 @@
import React from 'react';
import { shallow } from 'enzyme';
import PageTemplate from './index';
const env = { ...process.env };
afterEach(() => {
process.env = env;
});
beforeEach(() => {
process.env = {
...process.env,
BUILD_ID: 'test-id'
};
});
test('PageTemplate rendering', () => {
const component = shallow(
<PageTemplate>
<p>Content</p>
</PageTemplate>
);
expect(component).toMatchSnapshot();
});
test('PageTemplate rendering with title', () => {
const component = shallow(
<PageTemplate title="Example">
<p>Content</p>
</PageTemplate>
);
expect(component).toMatchSnapshot();
});