diff --git a/src/components/Feed/__snapshots__/Feed.test.js.snap b/src/components/Feed/__snapshots__/Feed.test.js.snap index d0bf186..1135d20 100644 --- a/src/components/Feed/__snapshots__/Feed.test.js.snap +++ b/src/components/Feed/__snapshots__/Feed.test.js.snap @@ -22,35 +22,35 @@ exports[`Feed renders correctly 1`] = ` - test_0 - +
test_0
- Read - +test_1
- Read - + `; diff --git a/src/components/Pagination/__snapshots__/Pagination.test.js.snap b/src/components/Pagination/__snapshots__/Pagination.test.js.snap index fe7d4bb..926c1bf 100644 --- a/src/components/Pagination/__snapshots__/Pagination.test.js.snap +++ b/src/components/Pagination/__snapshots__/Pagination.test.js.snap @@ -7,24 +7,24 @@ exports[`Pagination renders correctly 1`] = `
- test
+ Test bio
- test
+ Test name
on Twitter
diff --git a/src/components/Post/Comments/Comments.js b/src/components/Post/Comments/Comments.js
index 6388763..44f51de 100644
--- a/src/components/Post/Comments/Comments.js
+++ b/src/components/Post/Comments/Comments.js
@@ -1,12 +1,9 @@
import React from 'react';
-import { graphql, StaticQuery } from 'gatsby';
import ReactDisqusComments from 'react-disqus-comments';
+import { useSiteMetadata } from '../../../hooks';
-export const PureComments = ({ data, postTitle, postSlug }) => {
- const {
- url,
- disqusShortname
- } = data.site.siteMetadata;
+const Comments = ({ postTitle, postSlug }) => {
+ const { url, disqusShortname } = useSiteMetadata();
if (!disqusShortname) {
return null;
@@ -22,20 +19,4 @@ export const PureComments = ({ data, postTitle, postSlug }) => {
);
};
-export const Comments = (props) => (
-
test
', diff --git a/src/components/Post/Tags/__snapshots__/Tags.test.js.snap b/src/components/Post/Tags/__snapshots__/Tags.test.js.snap index cf2e9fa..b3b4787 100644 --- a/src/components/Post/Tags/__snapshots__/Tags.test.js.snap +++ b/src/components/Post/Tags/__snapshots__/Tags.test.js.snap @@ -10,22 +10,22 @@ exports[`Tags renders correctly 1`] = `+ Test bio + + + Test name + + on Twitter + +
+- Item 0 - +
- bio + Test bio
test_0
- Read - +test_1
- Read - +test_0
- Read - +test_1
- Read - ++ Test bio + + + Test name + + on Twitter + +
+test_0
- Read - +test_1
- Read - +test
', - frontmatter: { - title: 'test', - description: 'test' - } - }, - site: { - siteMetadata: { - title: 'test', - subtitle: 'test' - } - } + ...markdownRemark } }; + beforeEach(() => { + StaticQuery.mockImplementationOnce( + ({ render }) => ( + render(siteMetadata) + ), + useStaticQuery.mockReturnValue(siteMetadata) + ); + }); + it('renders correctly', () => { const tree = renderer.create(test
', - fields: { - tagSlugs: [ - '/test_0', - '/test_1' - ] - }, - frontmatter: { - date: '2016-09-01', - description: 'test', - title: 'test', - tags: [ - 'test_0', - 'test_1' - ] - } - } + ...markdownRemark } }; + beforeEach(() => { + StaticQuery.mockImplementationOnce( + ({ render }) => ( + render(siteMetadata) + ), + useStaticQuery.mockReturnValue(siteMetadata) + ); + }); + it('renders correctly', () => { const tree = renderer.create(