mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-07-29 13:42:28 +02:00
Upgrade to Gatsby v2
This commit is contained in:
67
src/templates/tag-template.test.js
Normal file
67
src/templates/tag-template.test.js
Normal file
@@ -0,0 +1,67 @@
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import TagTemplate from './tag-template';
|
||||
|
||||
describe('TagTemplate', () => {
|
||||
const props = {
|
||||
data: {
|
||||
allMarkdownRemark: {
|
||||
group: [
|
||||
{
|
||||
fieldValue: 'test_0',
|
||||
totalCount: 1
|
||||
},
|
||||
{
|
||||
fieldValue: 'test_1',
|
||||
totalCount: 2
|
||||
}
|
||||
],
|
||||
edges: [
|
||||
{
|
||||
node: {
|
||||
fields: {
|
||||
slug: '/test_0',
|
||||
categorySlug: '/test'
|
||||
},
|
||||
frontmatter: {
|
||||
date: '2016-09-01T23:46:37.121Z',
|
||||
description: 'test_0',
|
||||
category: 'test',
|
||||
title: 'test_0'
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
node: {
|
||||
fields: {
|
||||
slug: '/test_1',
|
||||
categorySlug: '/test'
|
||||
},
|
||||
frontmatter: {
|
||||
date: '2016-09-01T23:46:37.121Z',
|
||||
description: 'test_1',
|
||||
category: 'test',
|
||||
title: 'test_1'
|
||||
}
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
site: {
|
||||
siteMetadata: {
|
||||
title: 'test',
|
||||
subtitle: 'test'
|
||||
}
|
||||
}
|
||||
},
|
||||
pageContext: {
|
||||
tag: 'test',
|
||||
page: 1
|
||||
}
|
||||
};
|
||||
|
||||
it('renders correctly', () => {
|
||||
const tree = renderer.create(<TagTemplate {...props} />).toJSON();
|
||||
expect(tree).toMatchSnapshot();
|
||||
});
|
||||
});
|
Reference in New Issue
Block a user