mirror of
https://github.com/mastermindzh/rickvanlieshout.com
synced 2025-08-06 01:18:14 +02:00
improvement: flow coverage
This commit is contained in:
@@ -1,9 +1,15 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import moment from 'moment';
|
||||
import { Link } from 'gatsby';
|
||||
import type { Edges } from '../../types';
|
||||
import styles from './Feed.module.scss';
|
||||
|
||||
const Feed = ({ edges }) => (
|
||||
type Props = {
|
||||
edges: Edges
|
||||
};
|
||||
|
||||
const Feed = ({ edges }: Props) => (
|
||||
<div className={styles['feed']}>
|
||||
{edges.map((edge) => (
|
||||
<div className={styles['feed__item']} key={edge.node.fields.slug}>
|
||||
|
@@ -1,3 +1,4 @@
|
||||
// @flow
|
||||
import React from 'react';
|
||||
import renderer from 'react-test-renderer';
|
||||
import Feed from './Feed';
|
||||
@@ -9,28 +10,50 @@ describe('Feed', () => {
|
||||
node: {
|
||||
fields: {
|
||||
slug: '/test_0',
|
||||
categorySlug: '/test_0'
|
||||
categorySlug: '/test_0',
|
||||
tagSlugs: [
|
||||
'/test-1',
|
||||
'/test-2'
|
||||
]
|
||||
},
|
||||
frontmatter: {
|
||||
date: '2016-09-01',
|
||||
description: 'test_0',
|
||||
category: 'test_0',
|
||||
tags: [
|
||||
'test-1',
|
||||
'test-2'
|
||||
],
|
||||
title: 'test_0'
|
||||
}
|
||||
},
|
||||
id: 'test-123',
|
||||
html: '<p>test</p>'
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
node: {
|
||||
fields: {
|
||||
slug: '/test_1',
|
||||
categorySlug: '/test_1'
|
||||
categorySlug: '/test_1',
|
||||
tagSlugs: [
|
||||
'/test-1',
|
||||
'/test-2'
|
||||
]
|
||||
},
|
||||
frontmatter: {
|
||||
date: '2016-09-01',
|
||||
description: 'test_1',
|
||||
category: 'test_1',
|
||||
tags: [
|
||||
'test-1',
|
||||
'test-2'
|
||||
],
|
||||
title: 'test_1'
|
||||
}
|
||||
},
|
||||
id: 'test-321',
|
||||
html: '<p>test</p>'
|
||||
|
||||
}
|
||||
}
|
||||
]
|
||||
|
@@ -1 +1,2 @@
|
||||
// @flow
|
||||
export { default } from './Feed';
|
||||
|
Reference in New Issue
Block a user