Removing unused PageTemplate component
This commit is contained in:
parent
24062d978a
commit
44a9cad9b3
@ -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>
|
||||
`;
|
@ -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 };
|
@ -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();
|
||||
});
|
Loading…
Reference in New Issue
Block a user