Implementing translations

This commit is contained in:
Jeff Avallone 2019-01-06 13:03:07 -05:00
parent e1c4cb9068
commit 618b21bb93
19 changed files with 1296 additions and 705 deletions

View File

@ -11,6 +11,7 @@ ShallowWrapper {
}, },
} }
} }
t={[Function]}
/>, />,
Symbol(enzyme.__renderer__): Object { Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function], "batchedUpdates": [Function],
@ -30,25 +31,29 @@ ShallowWrapper {
className="list" className="list"
> >
<li> <li>
Created by <WithMergedOptions(TransComponent)>
<a Created by
href="mailto:jeff.avallone@gmail.com" <a
> href="mailto:jeff.avallone@gmail.com"
Jeff Avallone >
</a> Jeff Avallone
</a>
</WithMergedOptions(TransComponent)>
</li> </li>
<li> <li>
Generated images licensed: <WithMergedOptions(TransComponent)>
<a Generated images licensed:
href="http://creativecommons.org/licenses/by/3.0/" <a
rel="license external noopener noreferrer" href="http://creativecommons.org/licenses/by/3.0/"
target="_blank" rel="license external noopener noreferrer"
> target="_blank"
<img >
alt="Creative Commons CC-BY-3.0 License" <img
src="https://licensebuttons.net/l/by/3.0/80x15.png" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
/> src="https://licensebuttons.net/l/by/3.0/80x15.png"
</a> />
</a>
</WithMergedOptions(TransComponent)>
</li> </li>
</ul>, </ul>,
<div <div
@ -68,25 +73,29 @@ ShallowWrapper {
"props": Object { "props": Object {
"children": Array [ "children": Array [
<li> <li>
Created by <WithMergedOptions(TransComponent)>
<a Created by
href="mailto:jeff.avallone@gmail.com" <a
> href="mailto:jeff.avallone@gmail.com"
Jeff Avallone >
</a> Jeff Avallone
</a>
</WithMergedOptions(TransComponent)>
</li>, </li>,
<li> <li>
Generated images licensed: <WithMergedOptions(TransComponent)>
<a Generated images licensed:
href="http://creativecommons.org/licenses/by/3.0/" <a
rel="license external noopener noreferrer" href="http://creativecommons.org/licenses/by/3.0/"
target="_blank" rel="license external noopener noreferrer"
> target="_blank"
<img >
alt="Creative Commons CC-BY-3.0 License" <img
src="https://licensebuttons.net/l/by/3.0/80x15.png" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
/> src="https://licensebuttons.net/l/by/3.0/80x15.png"
</a> />
</a>
</WithMergedOptions(TransComponent)>
</li>, </li>,
], ],
"className": "list", "className": "list",
@ -98,31 +107,48 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": Array [ "children": <WithMergedOptions(TransComponent)>
"Created by ", Created by
<a <a
href="mailto:jeff.avallone@gmail.com" href="mailto:jeff.avallone@gmail.com"
> >
Jeff Avallone Jeff Avallone
</a>, </a>
], </WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": Array [ "rendered": Object {
"Created by ", "instance": null,
Object { "key": undefined,
"instance": null, "nodeType": "class",
"key": undefined, "props": Object {
"nodeType": "host", "children": Array [
"props": Object { "Created by ",
"children": "Jeff Avallone", <a
"href": "mailto:jeff.avallone@gmail.com", href="mailto:jeff.avallone@gmail.com"
}, >
"ref": null, Jeff Avallone
"rendered": "Jeff Avallone", </a>,
"type": "a", ],
}, },
], "ref": null,
"rendered": Array [
"Created by ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Jeff Avallone",
"href": "mailto:jeff.avallone@gmail.com",
},
"ref": null,
"rendered": "Jeff Avallone",
"type": "a",
},
],
"type": [Function],
},
"type": "li", "type": "li",
}, },
Object { Object {
@ -130,52 +156,74 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": Array [ "children": <WithMergedOptions(TransComponent)>
"Generated images licensed: ", Generated images licensed:
<a <a
href="http://creativecommons.org/licenses/by/3.0/" href="http://creativecommons.org/licenses/by/3.0/"
rel="license external noopener noreferrer" rel="license external noopener noreferrer"
target="_blank" target="_blank"
> >
<img <img
alt="Creative Commons CC-BY-3.0 License" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
src="https://licensebuttons.net/l/by/3.0/80x15.png" src="https://licensebuttons.net/l/by/3.0/80x15.png"
/> />
</a>, </a>
], </WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": Array [ "rendered": Object {
"Generated images licensed: ", "instance": null,
Object { "key": undefined,
"instance": null, "nodeType": "class",
"key": undefined, "props": Object {
"nodeType": "host", "children": Array [
"props": Object { "Generated images licensed: ",
"children": <img <a
alt="Creative Commons CC-BY-3.0 License" href="http://creativecommons.org/licenses/by/3.0/"
src="https://licensebuttons.net/l/by/3.0/80x15.png" rel="license external noopener noreferrer"
/>, target="_blank"
"href": "http://creativecommons.org/licenses/by/3.0/", >
"rel": "license external noopener noreferrer", <img
"target": "_blank", alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
}, src="https://licensebuttons.net/l/by/3.0/80x15.png"
"ref": null, />
"rendered": Object { </a>,
],
},
"ref": null,
"rendered": Array [
"Generated images licensed: ",
Object {
"instance": null, "instance": null,
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"alt": "Creative Commons CC-BY-3.0 License", "children": <img
"src": "https://licensebuttons.net/l/by/3.0/80x15.png", alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
src="https://licensebuttons.net/l/by/3.0/80x15.png"
/>,
"href": "http://creativecommons.org/licenses/by/3.0/",
"rel": "license external noopener noreferrer",
"target": "_blank",
}, },
"ref": null, "ref": null,
"rendered": null, "rendered": Object {
"type": "img", "instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"alt": "TRANSLATE(Creative Commons CC-BY-3.0 License)",
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
},
"ref": null,
"rendered": null,
"type": "img",
},
"type": "a",
}, },
"type": "a", ],
}, "type": [Function],
], },
"type": "li", "type": "li",
}, },
], ],
@ -207,25 +255,29 @@ ShallowWrapper {
className="list" className="list"
> >
<li> <li>
Created by <WithMergedOptions(TransComponent)>
<a Created by
href="mailto:jeff.avallone@gmail.com" <a
> href="mailto:jeff.avallone@gmail.com"
Jeff Avallone >
</a> Jeff Avallone
</a>
</WithMergedOptions(TransComponent)>
</li> </li>
<li> <li>
Generated images licensed: <WithMergedOptions(TransComponent)>
<a Generated images licensed:
href="http://creativecommons.org/licenses/by/3.0/" <a
rel="license external noopener noreferrer" href="http://creativecommons.org/licenses/by/3.0/"
target="_blank" rel="license external noopener noreferrer"
> target="_blank"
<img >
alt="Creative Commons CC-BY-3.0 License" <img
src="https://licensebuttons.net/l/by/3.0/80x15.png" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
/> src="https://licensebuttons.net/l/by/3.0/80x15.png"
</a> />
</a>
</WithMergedOptions(TransComponent)>
</li> </li>
</ul>, </ul>,
<div <div
@ -245,25 +297,29 @@ ShallowWrapper {
"props": Object { "props": Object {
"children": Array [ "children": Array [
<li> <li>
Created by <WithMergedOptions(TransComponent)>
<a Created by
href="mailto:jeff.avallone@gmail.com" <a
> href="mailto:jeff.avallone@gmail.com"
Jeff Avallone >
</a> Jeff Avallone
</a>
</WithMergedOptions(TransComponent)>
</li>, </li>,
<li> <li>
Generated images licensed: <WithMergedOptions(TransComponent)>
<a Generated images licensed:
href="http://creativecommons.org/licenses/by/3.0/" <a
rel="license external noopener noreferrer" href="http://creativecommons.org/licenses/by/3.0/"
target="_blank" rel="license external noopener noreferrer"
> target="_blank"
<img >
alt="Creative Commons CC-BY-3.0 License" <img
src="https://licensebuttons.net/l/by/3.0/80x15.png" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
/> src="https://licensebuttons.net/l/by/3.0/80x15.png"
</a> />
</a>
</WithMergedOptions(TransComponent)>
</li>, </li>,
], ],
"className": "list", "className": "list",
@ -275,31 +331,48 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": Array [ "children": <WithMergedOptions(TransComponent)>
"Created by ", Created by
<a <a
href="mailto:jeff.avallone@gmail.com" href="mailto:jeff.avallone@gmail.com"
> >
Jeff Avallone Jeff Avallone
</a>, </a>
], </WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": Array [ "rendered": Object {
"Created by ", "instance": null,
Object { "key": undefined,
"instance": null, "nodeType": "class",
"key": undefined, "props": Object {
"nodeType": "host", "children": Array [
"props": Object { "Created by ",
"children": "Jeff Avallone", <a
"href": "mailto:jeff.avallone@gmail.com", href="mailto:jeff.avallone@gmail.com"
}, >
"ref": null, Jeff Avallone
"rendered": "Jeff Avallone", </a>,
"type": "a", ],
}, },
], "ref": null,
"rendered": Array [
"Created by ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Jeff Avallone",
"href": "mailto:jeff.avallone@gmail.com",
},
"ref": null,
"rendered": "Jeff Avallone",
"type": "a",
},
],
"type": [Function],
},
"type": "li", "type": "li",
}, },
Object { Object {
@ -307,52 +380,74 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": Array [ "children": <WithMergedOptions(TransComponent)>
"Generated images licensed: ", Generated images licensed:
<a <a
href="http://creativecommons.org/licenses/by/3.0/" href="http://creativecommons.org/licenses/by/3.0/"
rel="license external noopener noreferrer" rel="license external noopener noreferrer"
target="_blank" target="_blank"
> >
<img <img
alt="Creative Commons CC-BY-3.0 License" alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
src="https://licensebuttons.net/l/by/3.0/80x15.png" src="https://licensebuttons.net/l/by/3.0/80x15.png"
/> />
</a>, </a>
], </WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": Array [ "rendered": Object {
"Generated images licensed: ", "instance": null,
Object { "key": undefined,
"instance": null, "nodeType": "class",
"key": undefined, "props": Object {
"nodeType": "host", "children": Array [
"props": Object { "Generated images licensed: ",
"children": <img <a
alt="Creative Commons CC-BY-3.0 License" href="http://creativecommons.org/licenses/by/3.0/"
src="https://licensebuttons.net/l/by/3.0/80x15.png" rel="license external noopener noreferrer"
/>, target="_blank"
"href": "http://creativecommons.org/licenses/by/3.0/", >
"rel": "license external noopener noreferrer", <img
"target": "_blank", alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
}, src="https://licensebuttons.net/l/by/3.0/80x15.png"
"ref": null, />
"rendered": Object { </a>,
],
},
"ref": null,
"rendered": Array [
"Generated images licensed: ",
Object {
"instance": null, "instance": null,
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"alt": "Creative Commons CC-BY-3.0 License", "children": <img
"src": "https://licensebuttons.net/l/by/3.0/80x15.png", alt="TRANSLATE(Creative Commons CC-BY-3.0 License)"
src="https://licensebuttons.net/l/by/3.0/80x15.png"
/>,
"href": "http://creativecommons.org/licenses/by/3.0/",
"rel": "license external noopener noreferrer",
"target": "_blank",
}, },
"ref": null, "ref": null,
"rendered": null, "rendered": Object {
"type": "img", "instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"alt": "TRANSLATE(Creative Commons CC-BY-3.0 License)",
"src": "https://licensebuttons.net/l/by/3.0/80x15.png",
},
"ref": null,
"rendered": null,
"type": "img",
},
"type": "a",
}, },
"type": "a", ],
}, "type": [Function],
], },
"type": "li", "type": "li",
}, },
], ],

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { StaticQuery, graphql } from 'gatsby'; import { StaticQuery, graphql } from 'gatsby';
import { withNamespaces, Trans } from 'react-i18next';
import style from './style.module.css'; import style from './style.module.css';
@ -14,20 +15,21 @@ const query = graphql`
} }
`; `;
export const FooterImpl = ({ site: { siteMetadata } }) => ( export const FooterImpl = ({ t, site: { siteMetadata } }) => (
<footer className={ style.footer }> <footer className={ style.footer }>
<ul className={ style.list }> <ul className={ style.list }>
<li> <li>
Created by <a href="mailto:jeff.avallone@gmail.com">Jeff Avallone</a> <Trans>Created by <a
href="mailto:jeff.avallone@gmail.com">Jeff Avallone</a></Trans>
</li> </li>
<li> <li>
Generated images licensed: <a <Trans>Generated images licensed: <a
href="http://creativecommons.org/licenses/by/3.0/" href="http://creativecommons.org/licenses/by/3.0/"
rel="license external noopener noreferrer" rel="license external noopener noreferrer"
target="_blank"> target="_blank">
<img src="https://licensebuttons.net/l/by/3.0/80x15.png" <img src="https://licensebuttons.net/l/by/3.0/80x15.png"
alt="Creative Commons CC-BY-3.0 License" /> alt={ t('Creative Commons CC-BY-3.0 License') } />
</a> </a></Trans>
</li> </li>
</ul> </ul>
<div className={ style.buildId }> <div className={ style.buildId }>
@ -37,6 +39,7 @@ export const FooterImpl = ({ site: { siteMetadata } }) => (
); );
FooterImpl.propTypes = { FooterImpl.propTypes = {
t: PropTypes.func.isRequired,
site: PropTypes.shape({ site: PropTypes.shape({
siteMetadata: PropTypes.shape({ siteMetadata: PropTypes.shape({
buildId: PropTypes.string.isRequired buildId: PropTypes.string.isRequired
@ -44,8 +47,9 @@ FooterImpl.propTypes = {
}).isRequired }).isRequired
}; };
const TranslatedFooter = withNamespaces()(FooterImpl);
const Footer = () => <StaticQuery query={ query } render={ data => ( const Footer = () => <StaticQuery query={ query } render={ data => (
<FooterImpl { ...data } /> <TranslatedFooter { ...data } />
) } />; ) } />;
export default Footer; export default Footer;

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import { mockT } from 'i18n';
import Footer, { FooterImpl } from 'components/Footer'; import Footer, { FooterImpl } from 'components/Footer';
describe('Footer', () => { describe('Footer', () => {
@ -13,7 +14,7 @@ describe('Footer', () => {
test('rendering implementation', () => { test('rendering implementation', () => {
const component = shallow( const component = shallow(
<FooterImpl site={{ siteMetadata: { buildId: 'abc-123' } }} /> <FooterImpl site={{ siteMetadata: { buildId: 'abc-123' } }} t={ mockT } />
); );
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });

View File

@ -46,14 +46,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li> </li>
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li> </li>
<li> <li>
@ -108,14 +112,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li>, </li>,
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li>, </li>,
<li> <li>
@ -140,7 +148,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a>, </a>,
}, },
"ref": null, "ref": null,
@ -154,7 +164,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/>, />,
"Source on GitLab", <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>,
], ],
"href": "https://gitlab.com/javallone/regexper-static", "href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer", "rel": "external noopener noreferrer",
@ -174,7 +186,17 @@ ShallowWrapper {
"rendered": null, "rendered": null,
"type": [Function], "type": [Function],
}, },
"Source on GitLab", Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Source on GitLab",
},
"ref": null,
"rendered": "Source on GitLab",
"type": [Function],
},
], ],
"type": "a", "type": "a",
}, },
@ -188,7 +210,9 @@ ShallowWrapper {
"children": <mockConstructor "children": <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor>, </mockConstructor>,
}, },
"ref": null, "ref": null,
@ -197,11 +221,23 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": "Privacy Policy", "children": <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>,
"to": "/privacy", "to": "/privacy",
}, },
"ref": null, "ref": null,
"rendered": "Privacy Policy", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Privacy Policy",
},
"ref": null,
"rendered": "Privacy Policy",
"type": [Function],
},
"type": [MockFunction], "type": [MockFunction],
}, },
"type": "li", "type": "li",
@ -258,14 +294,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li> </li>
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li> </li>
<li> <li>
@ -320,14 +360,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li>, </li>,
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li>, </li>,
<li> <li>
@ -352,7 +396,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a>, </a>,
}, },
"ref": null, "ref": null,
@ -366,7 +412,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/>, />,
"Source on GitLab", <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>,
], ],
"href": "https://gitlab.com/javallone/regexper-static", "href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer", "rel": "external noopener noreferrer",
@ -386,7 +434,17 @@ ShallowWrapper {
"rendered": null, "rendered": null,
"type": [Function], "type": [Function],
}, },
"Source on GitLab", Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Source on GitLab",
},
"ref": null,
"rendered": "Source on GitLab",
"type": [Function],
},
], ],
"type": "a", "type": "a",
}, },
@ -400,7 +458,9 @@ ShallowWrapper {
"children": <mockConstructor "children": <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor>, </mockConstructor>,
}, },
"ref": null, "ref": null,
@ -409,11 +469,23 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": "Privacy Policy", "children": <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>,
"to": "/privacy", "to": "/privacy",
}, },
"ref": null, "ref": null,
"rendered": "Privacy Policy", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Privacy Policy",
},
"ref": null,
"rendered": "Privacy Policy",
"type": [Function],
},
"type": [MockFunction], "type": [MockFunction],
}, },
"type": "li", "type": "li",
@ -510,14 +582,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li> </li>
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li> </li>
<li> <li>
@ -572,14 +648,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li>, </li>,
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li>, </li>,
<li> <li>
@ -604,7 +684,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a>, </a>,
}, },
"ref": null, "ref": null,
@ -618,7 +700,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/>, />,
"Source on GitLab", <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>,
], ],
"href": "https://gitlab.com/javallone/regexper-static", "href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer", "rel": "external noopener noreferrer",
@ -638,7 +722,17 @@ ShallowWrapper {
"rendered": null, "rendered": null,
"type": [Function], "type": [Function],
}, },
"Source on GitLab", Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Source on GitLab",
},
"ref": null,
"rendered": "Source on GitLab",
"type": [Function],
},
], ],
"type": "a", "type": "a",
}, },
@ -652,7 +746,9 @@ ShallowWrapper {
"children": <mockConstructor "children": <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor>, </mockConstructor>,
}, },
"ref": null, "ref": null,
@ -661,11 +757,23 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": "Privacy Policy", "children": <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>,
"to": "/privacy", "to": "/privacy",
}, },
"ref": null, "ref": null,
"rendered": "Privacy Policy", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Privacy Policy",
},
"ref": null,
"rendered": "Privacy Policy",
"type": [Function],
},
"type": [MockFunction], "type": [MockFunction],
}, },
"type": "li", "type": "li",
@ -722,14 +830,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li> </li>
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li> </li>
<li> <li>
@ -784,14 +896,18 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a> </a>
</li>, </li>,
<li> <li>
<mockConstructor <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor> </mockConstructor>
</li>, </li>,
<li> <li>
@ -816,7 +932,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/> />
Source on GitLab <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>
</a>, </a>,
}, },
"ref": null, "ref": null,
@ -830,7 +948,9 @@ ShallowWrapper {
color="currentColor" color="currentColor"
size="24" size="24"
/>, />,
"Source on GitLab", <WithMergedOptions(TransComponent)>
Source on GitLab
</WithMergedOptions(TransComponent)>,
], ],
"href": "https://gitlab.com/javallone/regexper-static", "href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer", "rel": "external noopener noreferrer",
@ -850,7 +970,17 @@ ShallowWrapper {
"rendered": null, "rendered": null,
"type": [Function], "type": [Function],
}, },
"Source on GitLab", Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Source on GitLab",
},
"ref": null,
"rendered": "Source on GitLab",
"type": [Function],
},
], ],
"type": "a", "type": "a",
}, },
@ -864,7 +994,9 @@ ShallowWrapper {
"children": <mockConstructor "children": <mockConstructor
to="/privacy" to="/privacy"
> >
Privacy Policy <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>
</mockConstructor>, </mockConstructor>,
}, },
"ref": null, "ref": null,
@ -873,11 +1005,23 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": "Privacy Policy", "children": <WithMergedOptions(TransComponent)>
Privacy Policy
</WithMergedOptions(TransComponent)>,
"to": "/privacy", "to": "/privacy",
}, },
"ref": null, "ref": null,
"rendered": "Privacy Policy", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Privacy Policy",
},
"ref": null,
"rendered": "Privacy Policy",
"type": [Function],
},
"type": [MockFunction], "type": [MockFunction],
}, },
"type": "li", "type": "li",

View File

@ -1,6 +1,7 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types'; import PropTypes from 'prop-types';
import { Link, StaticQuery, graphql } from 'gatsby'; import { Link, StaticQuery, graphql } from 'gatsby';
import { withNamespaces, Trans } from 'react-i18next';
import GitlabIcon from 'react-feather/dist/icons/gitlab'; import GitlabIcon from 'react-feather/dist/icons/gitlab';
@ -32,11 +33,13 @@ export const HeaderImpl = ({ site: { siteMetadata } }) => (
rel="external noopener noreferrer" rel="external noopener noreferrer"
target="_blank"> target="_blank">
<GitlabIcon /> <GitlabIcon />
Source on GitLab <Trans>Source on GitLab</Trans>
</a> </a>
</li> </li>
<li> <li>
<Link to="/privacy">Privacy Policy</Link> <Link to="/privacy">
<Trans>Privacy Policy</Trans>
</Link>
</li> </li>
<li> <li>
<LocaleSwitcher /> <LocaleSwitcher />
@ -56,8 +59,9 @@ HeaderImpl.propTypes = {
}).isRequired }).isRequired
}; };
const TranslatedHeader = withNamespaces()(HeaderImpl);
const Header = () => <StaticQuery query={ query } render={ data => ( const Header = () => <StaticQuery query={ query } render={ data => (
<HeaderImpl { ...data } /> <TranslatedHeader { ...data } />
) } />; ) } />;
export default Header; export default Header;

View File

@ -3,7 +3,9 @@
exports[`SentryError rendering 1`] = ` exports[`SentryError rendering 1`] = `
ShallowWrapper { ShallowWrapper {
Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <SentryError />, Symbol(enzyme.__unrendered__): <SentryErrorImpl
t={[Function]}
/>,
Symbol(enzyme.__renderer__): Object { Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function], "batchedUpdates": [Function],
"getNode": [Function], "getNode": [Function],
@ -18,64 +20,7 @@ ShallowWrapper {
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": <p> "children": <p>
This error has been logged. You may also <WithMergedOptions(TransComponent)>
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>
.
</p>,
"heading": "An error has occurred",
"type": "error",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
"This error has been logged. You may also ",
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>,
".",
],
},
"ref": null,
"rendered": Array [
"This error has been logged. You may also ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "fill out a report",
"href": "#error-report",
"onClick": [Function],
},
"ref": null,
"rendered": "fill out a report",
"type": "a",
},
".",
],
"type": "p",
},
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": <p>
This error has been logged. You may also This error has been logged. You may also
<a <a
href="#error-report" href="#error-report"
@ -84,15 +29,33 @@ ShallowWrapper {
fill out a report fill out a report
</a> </a>
. .
</p>, </WithMergedOptions(TransComponent)>
"heading": "An error has occurred", </p>,
"type": "error", "heading": "TRANSLATE(An error has occurred)",
"type": "error",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": <WithMergedOptions(TransComponent)>
This error has been logged. You may also
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>
.
</WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": Object { "rendered": Object {
"instance": null, "instance": null,
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "class",
"props": Object { "props": Object {
"children": Array [ "children": Array [
"This error has been logged. You may also ", "This error has been logged. You may also ",
@ -123,6 +86,87 @@ ShallowWrapper {
}, },
".", ".",
], ],
"type": [Function],
},
"type": "p",
},
"type": [Function],
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": <p>
<WithMergedOptions(TransComponent)>
This error has been logged. You may also
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>
.
</WithMergedOptions(TransComponent)>
</p>,
"heading": "TRANSLATE(An error has occurred)",
"type": "error",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": <WithMergedOptions(TransComponent)>
This error has been logged. You may also
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>
.
</WithMergedOptions(TransComponent)>,
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
"This error has been logged. You may also ",
<a
href="#error-report"
onClick={[Function]}
>
fill out a report
</a>,
".",
],
},
"ref": null,
"rendered": Array [
"This error has been logged. You may also ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "fill out a report",
"href": "#error-report",
"onClick": [Function],
},
"ref": null,
"rendered": "fill out a report",
"type": "a",
},
".",
],
"type": [Function],
},
"type": "p", "type": "p",
}, },
"type": [Function], "type": [Function],

View File

@ -1,9 +1,11 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import * as Sentry from '@sentry/browser'; import * as Sentry from '@sentry/browser';
import { withNamespaces, Trans } from 'react-i18next';
import Message from 'components/Message'; import Message from 'components/Message';
class SentryError extends React.Component { export class SentryErrorImpl extends React.Component {
reportError = event => { reportError = event => {
event.preventDefault(); event.preventDefault();
@ -13,11 +15,19 @@ class SentryError extends React.Component {
} }
render() { render() {
return <Message type="error" heading="An error has occurred"> const { t } = this.props;
<p>This error has been logged. You may also <a href="#error-report"
onClick={ this.reportError }>fill out a report</a>.</p> return <Message type="error" heading={ t('An error has occurred') }>
<p>
<Trans>This error has been logged. You may also <a href="#error-report"
onClick={ this.reportError }>fill out a report</a>.</Trans>
</p>
</Message>; </Message>;
} }
} }
export default SentryError; SentryErrorImpl.propTypes = {
t: PropTypes.func.isRequired
};
export default withNamespaces()(SentryErrorImpl);

View File

@ -4,12 +4,13 @@ import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import * as Sentry from '@sentry/browser'; import * as Sentry from '@sentry/browser';
import SentryError from 'components/SentryError'; import { mockT } from 'i18n';
import { SentryErrorImpl } from 'components/SentryError';
describe('SentryError', () => { describe('SentryError', () => {
test('rendering', () => { test('rendering', () => {
const component = shallow( const component = shallow(
<SentryError /> <SentryErrorImpl t={ mockT }/>
); );
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });
@ -18,7 +19,7 @@ describe('SentryError', () => {
test('fill out a report when an event has been logged', () => { test('fill out a report when an event has been logged', () => {
Sentry.lastEventId.mockReturnValue(1); Sentry.lastEventId.mockReturnValue(1);
const component = shallow( const component = shallow(
<SentryError /> <SentryErrorImpl t={ mockT } />
); );
const eventObj = { preventDefault: jest.fn() }; const eventObj = { preventDefault: jest.fn() };
component.find('a').simulate('click', eventObj); component.find('a').simulate('click', eventObj);
@ -30,7 +31,7 @@ describe('SentryError', () => {
test('fill out a report when an event has not been logged', () => { test('fill out a report when an event has not been logged', () => {
Sentry.lastEventId.mockReturnValue(false); Sentry.lastEventId.mockReturnValue(false);
const component = shallow( const component = shallow(
<SentryError /> <SentryErrorImpl t={ mockT } />
); );
const eventObj = { preventDefault: jest.fn() }; const eventObj = { preventDefault: jest.fn() };
component.find('a').simulate('click', eventObj); component.find('a').simulate('click', eventObj);

View File

@ -1,2 +1,45 @@
"Language": | "Language": |
LANGUAGE LANGUAGE
"Source on GitLab": |
SOURCE ON GITLAB
"Privacy Policy": |
PRIVACY POLICY
"Created by <1>Jeff Avallone</1>": |
CREATED BY <1>JEFF AVALLONE</1>
"Generated images licensed: <1><0></0></1>": |
GENERATED IMAGES LICENSED: <1><0></0></1>
"Creative Commons CC-BY-3.0 License": |
CREATIVE COMMONS CC-BY-3.0 LICENSE
"An error has occurred": |
AN ERROR HAS OCCURRED
"This error has been logged. You may also <1>fill out a report</1>.": |
THIS ERROR HAS BEEN LOGGED. YOU MAY ALSO <1>FILL OUT A REPORT</1>.
"Hello world": |
HELLO WORLD
"Privacy policy copy": |
<0>REGEXPER AND THE TOOLS USED TO CREATE IT ARE ALL OPEN SOURCE. If you are
concerned that the JavaScript being delivered is in any way malicious, please
inspect the source in the <1>GitLab repository</1>.</0>
<1>There are two data collection tools integrated in the app. These tools are
not used to collect personal information:</1>
<2>
<0><0>Google Analytics</0> is used to track browser usage data and
application performance. It is configured to anonymize the client IP
address.</0>
<1><0>Sentry.io</0> is a tool used to capture and report client-side
JavaScript errors. It is configured to not store the client IP address.</1>
</2>
<3>Regexper honors the browser <1>“Do Not Track”</1> setting and will not
enable these data collection tools if that setting is enabled. Also, most
popular ad blockers will prevent these tools from sending any tracking data.
Disabling or blocking these data collection tools will <3>not</3> impact the
performance of this app. The information collected by these tools is used to
monitor application performance, determine browser support, and collect error
reports.</3>
<4>Regexper is not supported by ad revenue or sales of any kind.</4>
"Page Not Found": |
PAGE NOT FOUND
"404 Page Not Found": |
404 PAGE NOT FOUND
"The page you have requested could not be found.": |
THE PAGE YOU HAVE REQUESTED COULD NOT BE FOUND.

View File

@ -1,2 +1,45 @@
"Language": | "Language": |
Language Language
"Source on GitLab": |
Source on GitLab
"Privacy Policy": |
Privacy Policy
"Created by <1>Jeff Avallone</1>": |
Created by <1>Jeff Avallone</1>
"Generated images licensed: <1><0></0></1>": |
Generated images licensed: <1><0></0></1>
"Creative Commons CC-BY-3.0 License": |
Creative Commons CC-BY-3.0 License
"An error has occurred": |
An error has occurred
"This error has been logged. You may also <1>fill out a report</1>.": |
This error has been logged. You may also <1>fill out a report</1>.
"Hello world": |
Hello world
"Privacy policy copy": |
<0>Regexper and the tools used to create it are all open source. If you are
concerned that the JavaScript being delivered is in any way malicious, please
inspect the source in the <1>GitLab repository</1>.</0>
<1>There are two data collection tools integrated in the app. These tools are
not used to collect personal information:</1>
<2>
<0><0>Google Analytics</0> is used to track browser usage data and
application performance. It is configured to anonymize the client IP
address.</0>
<1><0>Sentry.io</0> is a tool used to capture and report client-side
JavaScript errors. It is configured to not store the client IP address.</1>
</2>
<3>Regexper honors the browser <1>“Do Not Track”</1> setting and will not
enable these data collection tools if that setting is enabled. Also, most
popular ad blockers will prevent these tools from sending any tracking data.
Disabling or blocking these data collection tools will <3>not</3> impact the
performance of this app. The information collected by these tools is used to
monitor application performance, determine browser support, and collect error
reports.</3>
<4>Regexper is not supported by ad revenue or sales of any kind.</4>
"Page Not Found": |
Page Not Found
"404 Page Not Found": |
404 Page Not Found
"The page you have requested could not be found.": |
The page you have requested could not be found.

View File

@ -1,13 +1,19 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import { withNamespaces, Trans } from 'react-i18next';
import Metadata from 'components/Metadata'; import Metadata from 'components/Metadata';
import Message from 'components/Message'; import Message from 'components/Message';
const ErrorPage = () => <> export const ErrorPageImpl = ({ t }) => <>
<Metadata title="Page Not Found" /> <Metadata title={ t('Page Not Found') } />
<Message type="error" heading="404 Page Not Found"> <Message type="error" heading={ t('404 Page Not Found') }>
<p>The page you have requrested could not be found.</p> <p><Trans>The page you have requested could not be found.</Trans></p>
</Message> </Message>
</>; </>;
export default ErrorPage; ErrorPageImpl.propTypes = {
t: PropTypes.func.isRequired
};
export default withNamespaces()(ErrorPageImpl);

View File

@ -1,12 +1,13 @@
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import ErrorPage from 'pages/404'; import { mockT } from 'i18n';
import { ErrorPageImpl } from 'pages/404';
describe('Error Page', () => { describe('Error Page', () => {
test('rendering', () => { test('rendering', () => {
const component = shallow( const component = shallow(
<ErrorPage /> <ErrorPageImpl t={ mockT } />
); );
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });

View File

@ -3,7 +3,9 @@
exports[`Error Page rendering 1`] = ` exports[`Error Page rendering 1`] = `
ShallowWrapper { ShallowWrapper {
Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <ErrorPage />, Symbol(enzyme.__unrendered__): <ErrorPageImpl
t={[Function]}
/>,
Symbol(enzyme.__renderer__): Object { Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function], "batchedUpdates": [Function],
"getNode": [Function], "getNode": [Function],
@ -19,14 +21,16 @@ ShallowWrapper {
"props": Object { "props": Object {
"children": Array [ "children": Array [
<Metadata <Metadata
title="Page Not Found" title="TRANSLATE(Page Not Found)"
/>, />,
<Message <Message
heading="404 Page Not Found" heading="TRANSLATE(404 Page Not Found)"
type="error" type="error"
> >
<p> <p>
The page you have requrested could not be found. <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>
</p> </p>
</Message>, </Message>,
], ],
@ -38,7 +42,7 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"title": "Page Not Found", "title": "TRANSLATE(Page Not Found)",
}, },
"ref": null, "ref": null,
"rendered": null, "rendered": null,
@ -50,9 +54,11 @@ ShallowWrapper {
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": <p> "children": <p>
The page you have requrested could not be found. <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>
</p>, </p>,
"heading": "404 Page Not Found", "heading": "TRANSLATE(404 Page Not Found)",
"type": "error", "type": "error",
}, },
"ref": null, "ref": null,
@ -61,10 +67,22 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": "The page you have requrested could not be found.", "children": <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": "The page you have requrested could not be found.", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "The page you have requested could not be found.",
},
"ref": null,
"rendered": "The page you have requested could not be found.",
"type": [Function],
},
"type": "p", "type": "p",
}, },
"type": [Function], "type": [Function],
@ -80,14 +98,16 @@ ShallowWrapper {
"props": Object { "props": Object {
"children": Array [ "children": Array [
<Metadata <Metadata
title="Page Not Found" title="TRANSLATE(Page Not Found)"
/>, />,
<Message <Message
heading="404 Page Not Found" heading="TRANSLATE(404 Page Not Found)"
type="error" type="error"
> >
<p> <p>
The page you have requrested could not be found. <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>
</p> </p>
</Message>, </Message>,
], ],
@ -99,7 +119,7 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"title": "Page Not Found", "title": "TRANSLATE(Page Not Found)",
}, },
"ref": null, "ref": null,
"rendered": null, "rendered": null,
@ -111,9 +131,11 @@ ShallowWrapper {
"nodeType": "function", "nodeType": "function",
"props": Object { "props": Object {
"children": <p> "children": <p>
The page you have requrested could not be found. <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>
</p>, </p>,
"heading": "404 Page Not Found", "heading": "TRANSLATE(404 Page Not Found)",
"type": "error", "type": "error",
}, },
"ref": null, "ref": null,
@ -122,10 +144,22 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": "The page you have requrested could not be found.", "children": <WithMergedOptions(TransComponent)>
The page you have requested could not be found.
</WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": "The page you have requrested could not be found.", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "The page you have requested could not be found.",
},
"ref": null,
"rendered": "The page you have requested could not be found.",
"type": [Function],
},
"type": "p", "type": "p",
}, },
"type": [Function], "type": [Function],

View File

@ -3,7 +3,7 @@
exports[`Index Page rendering 1`] = ` exports[`Index Page rendering 1`] = `
ShallowWrapper { ShallowWrapper {
Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <IndexPage />, Symbol(enzyme.__unrendered__): <IndexPageImpl />,
Symbol(enzyme.__renderer__): Object { Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function], "batchedUpdates": [Function],
"getNode": [Function], "getNode": [Function],
@ -39,7 +39,9 @@ ShallowWrapper {
</Message> </Message>
</noscript>, </noscript>,
<div> <div>
Hello world <WithMergedOptions(TransComponent)>
Hello world
</WithMergedOptions(TransComponent)>
</div>, </div>,
], ],
}, },
@ -157,10 +159,22 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": "Hello world", "children": <WithMergedOptions(TransComponent)>
Hello world
</WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": "Hello world", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Hello world",
},
"ref": null,
"rendered": "Hello world",
"type": [Function],
},
"type": "div", "type": "div",
}, },
], ],
@ -194,7 +208,9 @@ ShallowWrapper {
</Message> </Message>
</noscript>, </noscript>,
<div> <div>
Hello world <WithMergedOptions(TransComponent)>
Hello world
</WithMergedOptions(TransComponent)>
</div>, </div>,
], ],
}, },
@ -312,10 +328,22 @@ ShallowWrapper {
"key": undefined, "key": undefined,
"nodeType": "host", "nodeType": "host",
"props": Object { "props": Object {
"children": "Hello world", "children": <WithMergedOptions(TransComponent)>
Hello world
</WithMergedOptions(TransComponent)>,
}, },
"ref": null, "ref": null,
"rendered": "Hello world", "rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": "Hello world",
},
"ref": null,
"rendered": "Hello world",
"type": [Function],
},
"type": "div", "type": "div",
}, },
], ],

View File

@ -3,7 +3,9 @@
exports[`Privacy Page rendering 1`] = ` exports[`Privacy Page rendering 1`] = `
ShallowWrapper { ShallowWrapper {
Symbol(enzyme.__root__): [Circular], Symbol(enzyme.__root__): [Circular],
Symbol(enzyme.__unrendered__): <PrivacyPage />, Symbol(enzyme.__unrendered__): <PrivacyPageImpl
t={[Function]}
/>,
Symbol(enzyme.__renderer__): Object { Symbol(enzyme.__renderer__): Object {
"batchedUpdates": [Function], "batchedUpdates": [Function],
"getNode": [Function], "getNode": [Function],
@ -19,333 +21,14 @@ ShallowWrapper {
"props": Object { "props": Object {
"children": Array [ "children": Array [
<Metadata <Metadata
title="Privacy Policy" title="TRANSLATE(Privacy Policy)"
/>, />,
<Message <Message
heading="Privacy Policy" heading="TRANSLATE(Privacy Policy)"
type="info" type="info"
> >
<p> <WithMergedOptions(TransComponent)
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the i18nKey="Privacy policy copy"
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</Message>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"title": "Privacy Policy",
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": Array [
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>,
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>,
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>,
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>,
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>,
],
"heading": "Privacy Policy",
"type": "info",
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
"Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the ",
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>,
".",
],
},
"ref": null,
"rendered": Array [
"Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "GitLab repository",
"href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer",
"target": "_blank",
},
"ref": null,
"rendered": "GitLab repository",
"type": "a",
},
".",
],
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "There are two data collection tools integrated in the app. These tools are not used to collect personal information:",
},
"ref": null,
"rendered": "There are two data collection tools integrated in the app. These tools are not used to collect personal information:",
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>,
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<b>
Google Analytics
</b>,
" is used to track browser usage data and application performance. It is configured to anonymize the client IP address.",
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Google Analytics",
},
"ref": null,
"rendered": "Google Analytics",
"type": "b",
},
" is used to track browser usage data and application performance. It is configured to anonymize the client IP address.",
],
"type": "li",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<b>
Sentry.io
</b>,
" is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.",
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Sentry.io",
},
"ref": null,
"rendered": "Sentry.io",
"type": "b",
},
" is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.",
],
"type": "li",
},
],
"type": "ul",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
"Regexper honors the browser ",
<b>
“Do Not Track”
</b>,
" setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will ",
<b>
not
</b>,
" impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.",
],
},
"ref": null,
"rendered": Array [
"Regexper honors the browser ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "“Do Not Track”",
},
"ref": null,
"rendered": "“Do Not Track”",
"type": "b",
},
" setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "not",
},
"ref": null,
"rendered": "not",
"type": "b",
},
" impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.",
],
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Regexper is not supported by ad revenue or sales of any kind.",
},
"ref": null,
"rendered": "Regexper is not supported by ad revenue or sales of any kind.",
"type": "p",
},
],
"type": [Function],
},
],
"type": Symbol(react.fragment),
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": Array [
<Metadata
title="Privacy Policy"
/>,
<Message
heading="Privacy Policy"
type="info"
> >
<p> <p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
@ -389,26 +72,82 @@ ShallowWrapper {
<p> <p>
Regexper is not supported by ad revenue or sales of any kind. Regexper is not supported by ad revenue or sales of any kind.
</p> </p>
</Message>, </WithMergedOptions(TransComponent)>
], </Message>,
}, ],
"ref": null, },
"rendered": Array [ "ref": null,
Object { "rendered": Array [
"instance": null, Object {
"key": undefined, "instance": null,
"nodeType": "function", "key": undefined,
"props": Object { "nodeType": "function",
"title": "Privacy Policy", "props": Object {
}, "title": "TRANSLATE(Privacy Policy)",
"ref": null,
"rendered": null,
"type": [Function],
}, },
Object { "ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": <WithMergedOptions(TransComponent)
i18nKey="Privacy policy copy"
>
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</WithMergedOptions(TransComponent)>,
"heading": "TRANSLATE(Privacy Policy)",
"type": "info",
},
"ref": null,
"rendered": Object {
"instance": null, "instance": null,
"key": undefined, "key": undefined,
"nodeType": "function", "nodeType": "class",
"props": Object { "props": Object {
"children": Array [ "children": Array [
<p> <p>
@ -454,8 +193,7 @@ ShallowWrapper {
Regexper is not supported by ad revenue or sales of any kind. Regexper is not supported by ad revenue or sales of any kind.
</p>, </p>,
], ],
"heading": "Privacy Policy", "i18nKey": "Privacy policy copy",
"type": "info",
}, },
"ref": null, "ref": null,
"rendered": Array [ "rendered": Array [
@ -652,6 +390,390 @@ ShallowWrapper {
], ],
"type": [Function], "type": [Function],
}, },
"type": [Function],
},
],
"type": Symbol(react.fragment),
},
Symbol(enzyme.__nodes__): Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": Array [
<Metadata
title="TRANSLATE(Privacy Policy)"
/>,
<Message
heading="TRANSLATE(Privacy Policy)"
type="info"
>
<WithMergedOptions(TransComponent)
i18nKey="Privacy policy copy"
>
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</WithMergedOptions(TransComponent)>
</Message>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"title": "TRANSLATE(Privacy Policy)",
},
"ref": null,
"rendered": null,
"type": [Function],
},
Object {
"instance": null,
"key": undefined,
"nodeType": "function",
"props": Object {
"children": <WithMergedOptions(TransComponent)
i18nKey="Privacy policy copy"
>
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</WithMergedOptions(TransComponent)>,
"heading": "TRANSLATE(Privacy Policy)",
"type": "info",
},
"ref": null,
"rendered": Object {
"instance": null,
"key": undefined,
"nodeType": "class",
"props": Object {
"children": Array [
<p>
Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>
.
</p>,
<p>
There are two data collection tools integrated in the app. These tools are not used to collect personal information:
</p>,
<ul>
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>
</ul>,
<p>
Regexper honors the browser
<b>
“Do Not Track”
</b>
setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will
<b>
not
</b>
impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.
</p>,
<p>
Regexper is not supported by ad revenue or sales of any kind.
</p>,
],
"i18nKey": "Privacy policy copy",
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
"Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the ",
<a
href="https://gitlab.com/javallone/regexper-static"
rel="external noopener noreferrer"
target="_blank"
>
GitLab repository
</a>,
".",
],
},
"ref": null,
"rendered": Array [
"Regexper and the tools used to create it are all open source. If you are concerned that the JavaScript being delivered is in any way malicious, please inspect the source in the ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "GitLab repository",
"href": "https://gitlab.com/javallone/regexper-static",
"rel": "external noopener noreferrer",
"target": "_blank",
},
"ref": null,
"rendered": "GitLab repository",
"type": "a",
},
".",
],
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "There are two data collection tools integrated in the app. These tools are not used to collect personal information:",
},
"ref": null,
"rendered": "There are two data collection tools integrated in the app. These tools are not used to collect personal information:",
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<li>
<b>
Google Analytics
</b>
is used to track browser usage data and application performance. It is configured to anonymize the client IP address.
</li>,
<li>
<b>
Sentry.io
</b>
is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.
</li>,
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<b>
Google Analytics
</b>,
" is used to track browser usage data and application performance. It is configured to anonymize the client IP address.",
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Google Analytics",
},
"ref": null,
"rendered": "Google Analytics",
"type": "b",
},
" is used to track browser usage data and application performance. It is configured to anonymize the client IP address.",
],
"type": "li",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
<b>
Sentry.io
</b>,
" is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.",
],
},
"ref": null,
"rendered": Array [
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Sentry.io",
},
"ref": null,
"rendered": "Sentry.io",
"type": "b",
},
" is a tool used to capture and report client-side JavaScript errors. It is configured to not store the client IP address.",
],
"type": "li",
},
],
"type": "ul",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": Array [
"Regexper honors the browser ",
<b>
“Do Not Track”
</b>,
" setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will ",
<b>
not
</b>,
" impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.",
],
},
"ref": null,
"rendered": Array [
"Regexper honors the browser ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "“Do Not Track”",
},
"ref": null,
"rendered": "“Do Not Track”",
"type": "b",
},
" setting and will not enable these data collection tools if that setting is enabled. Also, most popular ad blockers will prevent these tools from sending any tracking data. Disabling or blocking these data collection tools will ",
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "not",
},
"ref": null,
"rendered": "not",
"type": "b",
},
" impact the performance of this app. The information collected by these tools is used to monitor application performance, determine browser support, and collect error reports.",
],
"type": "p",
},
Object {
"instance": null,
"key": undefined,
"nodeType": "host",
"props": Object {
"children": "Regexper is not supported by ad revenue or sales of any kind.",
},
"ref": null,
"rendered": "Regexper is not supported by ad revenue or sales of any kind.",
"type": "p",
},
],
"type": [Function],
},
"type": [Function],
},
], ],
"type": Symbol(react.fragment), "type": Symbol(react.fragment),
}, },

View File

@ -1,10 +1,11 @@
import React from 'react'; import React from 'react';
import { Link } from 'gatsby'; import { Link } from 'gatsby';
import { withNamespaces, Trans } from 'react-i18next';
import Metadata from 'components/Metadata'; import Metadata from 'components/Metadata';
import Message from 'components/Message'; import Message from 'components/Message';
const IndexPage = () => <> export const IndexPageImpl = () => <>
<Metadata/> <Metadata/>
<noscript> <noscript>
<Message type="error" heading="JavaScript Required"> <Message type="error" heading="JavaScript Required">
@ -13,7 +14,7 @@ const IndexPage = () => <>
please see the <Link to="/privacy">Privacy Policy</Link>.</p> please see the <Link to="/privacy">Privacy Policy</Link>.</p>
</Message> </Message>
</noscript> </noscript>
<div>Hello world</div> <div><Trans>Hello world</Trans></div>
</>; </>;
export default IndexPage; export default withNamespaces()(IndexPageImpl);

View File

@ -1,12 +1,12 @@
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import IndexPage from 'pages/index'; import { IndexPageImpl } from 'pages/index';
describe('Index Page', () => { describe('Index Page', () => {
test('rendering', () => { test('rendering', () => {
const component = shallow( const component = shallow(
<IndexPage /> <IndexPageImpl />
); );
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });

View File

@ -1,47 +1,56 @@
import React from 'react'; import React from 'react';
import PropTypes from 'prop-types';
import { withNamespaces, Trans } from 'react-i18next';
import Metadata from 'components/Metadata'; import Metadata from 'components/Metadata';
import Message from 'components/Message'; import Message from 'components/Message';
const PrivacyPage = () => <> export const PrivacyPageImpl = ({ t }) => <>
<Metadata title="Privacy Policy" /> <Metadata title={ t('Privacy Policy') } />
<Message type="info" heading="Privacy Policy"> <Message type="info" heading={ t('Privacy Policy') }>
<p> <Trans i18nKey="Privacy policy copy">
Regexper and the tools used to create it are all open source. If you are <p>
concerned that the JavaScript being delivered is in any way malicious, Regexper and the tools used to create it are all open source. If you are
please inspect the source in the <a concerned that the JavaScript being delivered is in any way malicious,
href="https://gitlab.com/javallone/regexper-static" please inspect the source in the <a
rel="external noopener noreferrer" href="https://gitlab.com/javallone/regexper-static"
target="_blank">GitLab repository</a>. rel="external noopener noreferrer"
</p> target="_blank">GitLab repository</a>.
<p> </p>
There are two data collection tools integrated in the app. These tools <p>
are not used to collect personal information: There are two data collection tools integrated in the app. These tools
</p> are not used to collect personal information:
<ul> </p>
<li> <ul>
<b>Google Analytics</b> is used to track browser usage data and <li>
application performance. It is configured to anonymize the client IP <b>Google Analytics</b> is used to track browser usage data and
address. application performance. It is configured to anonymize the client IP
</li> address.
<li> </li>
<b>Sentry.io</b> is a tool used to capture and report client-side <li>
JavaScript errors. It is configured to not store the client IP address. <b>Sentry.io</b> is a tool used to capture and report client-side
</li> JavaScript errors. It is configured to not store the client IP
</ul> address.
<p> </li>
Regexper honors the browser <b>&ldquo;Do Not Track&rdquo;</b> setting and </ul>
will not enable these data collection tools if that setting is enabled. <p>
Also, most popular ad blockers will prevent these tools from sending any Regexper honors the browser <b>&ldquo;Do Not Track&rdquo;</b> setting
tracking data. Disabling or blocking these data collection tools and will not enable these data collection tools if that setting is
will <b>not</b> impact the performance of this app. The information enabled. Also, most popular ad blockers will prevent these tools from
collected by these tools is used to monitor application performance, sending any tracking data. Disabling or blocking these data collection
determine browser support, and collect error reports. tools will <b>not</b> impact the performance of this app. The
</p> information collected by these tools is used to monitor application
<p> performance, determine browser support, and collect error reports.
Regexper is not supported by ad revenue or sales of any kind. </p>
</p> <p>
Regexper is not supported by ad revenue or sales of any kind.
</p>
</Trans>
</Message> </Message>
</>; </>;
export default PrivacyPage; PrivacyPageImpl.propTypes = {
t: PropTypes.func.isRequired
};
export default withNamespaces()(PrivacyPageImpl);

View File

@ -1,12 +1,13 @@
import React from 'react'; import React from 'react';
import { shallow } from 'enzyme'; import { shallow } from 'enzyme';
import PrivacyPage from 'pages/privacy'; import { mockT } from 'i18n';
import { PrivacyPageImpl } from 'pages/privacy';
describe('Privacy Page', () => { describe('Privacy Page', () => {
test('rendering', () => { test('rendering', () => {
const component = shallow( const component = shallow(
<PrivacyPage /> <PrivacyPageImpl t={ mockT } />
); );
expect(component).toMatchSnapshot(); expect(component).toMatchSnapshot();
}); });