improvement: flow coverage

This commit is contained in:
alxshelepenok
2019-05-10 02:15:43 +03:00
parent 091834f16a
commit 35f2170bf5
66 changed files with 308 additions and 56 deletions

View File

@@ -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}>

View File

@@ -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>'
}
}
]

View File

@@ -1 +1,2 @@
// @flow
export { default } from './Feed';