From bf35f26d5bd545827c9edaf2e06239b4d125130a Mon Sep 17 00:00:00 2001 From: Jeff Avallone Date: Sun, 6 Jan 2019 13:25:33 -0500 Subject: [PATCH] Reworking internal component naming for clarity --- .../Footer/__snapshots__/test.js.snap | 78 +------------ src/components/Footer/index.js | 15 ++- src/components/Footer/test.js | 13 +-- .../Header/__snapshots__/test.js.snap | 106 +++--------------- src/components/Header/index.js | 15 ++- src/components/Header/test.js | 17 +-- .../Layout/__snapshots__/test.js.snap | 16 +-- .../LocaleSwitcher/__snapshots__/test.js.snap | 2 +- src/components/LocaleSwitcher/index.js | 4 +- src/components/LocaleSwitcher/test.js | 6 +- .../SentryError/__snapshots__/test.js.snap | 2 +- src/components/SentryError/index.js | 6 +- src/components/SentryError/test.js | 8 +- src/pages/404.js | 6 +- src/pages/404.test.js | 4 +- src/pages/__snapshots__/404.test.js.snap | 2 +- src/pages/__snapshots__/index.test.js.snap | 2 +- src/pages/__snapshots__/privacy.test.js.snap | 2 +- src/pages/index.js | 4 +- src/pages/index.test.js | 4 +- src/pages/privacy.js | 6 +- src/pages/privacy.test.js | 4 +- 22 files changed, 79 insertions(+), 243 deletions(-) diff --git a/src/components/Footer/__snapshots__/test.js.snap b/src/components/Footer/__snapshots__/test.js.snap index 29293d3..a11faa4 100644 --- a/src/components/Footer/__snapshots__/test.js.snap +++ b/src/components/Footer/__snapshots__/test.js.snap @@ -1,9 +1,9 @@ // Jest Snapshot v1, https://goo.gl/fbAQLP -exports[`Footer rendering implementation 1`] = ` +exports[`Footer rendering 1`] = ` ShallowWrapper { Symbol(enzyme.__root__): [Circular], - Symbol(enzyme.__unrendered__): , - Symbol(enzyme.__renderer__): Object { - "batchedUpdates": [Function], - "getNode": [Function], - "render": [Function], - "simulateError": [Function], - "simulateEvent": [Function], - "unmount": [Function], - }, - Symbol(enzyme.__node__): Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object { - "query": " - query FooterQuery { - site { - siteMetadata { - buildId - } - } - } -", - "render": [Function], - }, - "ref": null, - "rendered": null, - "type": [MockFunction], - }, - Symbol(enzyme.__nodes__): Array [ - Object { - "instance": null, - "key": undefined, - "nodeType": "function", - "props": Object { - "query": " - query FooterQuery { - site { - siteMetadata { - buildId - } - } - } -", - "render": [Function], - }, - "ref": null, - "rendered": null, - "type": [MockFunction], - }, - ], - Symbol(enzyme.__options__): Object { - "adapter": ReactSixteenAdapter { - "options": Object { - "enableComponentDidUpdateOnSetState": true, - "lifecycles": Object { - "componentDidUpdate": Object { - "onSetState": true, - }, - "getDerivedStateFromProps": true, - "getSnapshotBeforeUpdate": true, - "setState": Object { - "skipsComponentDidUpdateOnNullish": true, - }, - }, - }, - }, - }, -} -`; diff --git a/src/components/Footer/index.js b/src/components/Footer/index.js index d64abb9..7c0c9de 100644 --- a/src/components/Footer/index.js +++ b/src/components/Footer/index.js @@ -15,7 +15,7 @@ const query = graphql` } `; -export const FooterImpl = ({ t, site: { siteMetadata } }) => ( +export const Footer = ({ t, site: { siteMetadata } }) => (
  • @@ -38,7 +38,7 @@ export const FooterImpl = ({ t, site: { siteMetadata } }) => (
); -FooterImpl.propTypes = { +Footer.propTypes = { t: PropTypes.func.isRequired, site: PropTypes.shape({ siteMetadata: PropTypes.shape({ @@ -47,9 +47,8 @@ FooterImpl.propTypes = { }).isRequired }; -const TranslatedFooter = withNamespaces()(FooterImpl); -const Footer = () => ( - -) } />; - -export default Footer; +export default withNamespaces()(props => ( + ( +