Upgrade to Gatsby v2

This commit is contained in:
alxshelepenok
2018-11-09 20:08:48 +03:00
parent e83dfc6dff
commit 8b92891329
204 changed files with 18708 additions and 3904 deletions

View File

@@ -0,0 +1,56 @@
import React from 'react';
import renderer from 'react-test-renderer';
import IndexTemplate from './index-template';
describe('IndexTemplate', () => {
const props = {
data: {
allMarkdownRemark: {
edges: [
{
node: {
fields: {
slug: '/test_0',
categorySlug: '/test_0'
},
frontmatter: {
date: '2016-09-01T23:46:37.121Z',
description: 'test_0',
category: 'test_0',
title: 'test_0'
}
}
},
{
node: {
fields: {
slug: '/test_1',
categorySlug: '/test_1'
},
frontmatter: {
date: '2016-09-01T23:46:37.121Z',
description: 'test_1',
category: 'test_1',
title: 'test_1'
}
}
}
]
},
site: {
siteMetadata: {
title: 'test',
subtitle: 'test'
}
}
},
pageContext: {
page: 1
}
};
it('renders correctly', () => {
const tree = renderer.create(<IndexTemplate {...props} />).toJSON();
expect(tree).toMatchSnapshot();
});
});