mirror of
				https://github.com/mastermindzh/rickvanlieshout.com
				synced 2025-10-31 16:49:49 +01:00 
			
		
		
		
	improvement: flow coverage
This commit is contained in:
		| @@ -1,8 +1,14 @@ | ||||
| // @flow | ||||
| import React from 'react'; | ||||
| import ReactDisqusComments from 'react-disqus-comments'; | ||||
| import { useSiteMetadata } from '../../../hooks'; | ||||
|  | ||||
| const Comments = ({ postTitle, postSlug }) => { | ||||
| type Props = { | ||||
|   postTitle: string, | ||||
|   postSlug: string | ||||
| }; | ||||
|  | ||||
| const Comments = ({ postTitle, postSlug }: Props) => { | ||||
|   const { url, disqusShortname } = useSiteMetadata(); | ||||
|  | ||||
|   if (!disqusShortname) { | ||||
|   | ||||
| @@ -1,13 +1,15 @@ | ||||
| // @flow | ||||
| import React from 'react'; | ||||
| import renderer from 'react-test-renderer'; | ||||
| import { useStaticQuery, StaticQuery } from 'gatsby'; | ||||
| import Comments from './Comments'; | ||||
| import siteMetadata from '../../../../jest/__fixtures__/site-metadata'; | ||||
| import type { RenderCallback } from '../../../types'; | ||||
|  | ||||
| describe('Comments', () => { | ||||
|   beforeEach(() => { | ||||
|     StaticQuery.mockImplementationOnce( | ||||
|       ({ render }) => ( | ||||
|       ({ render }: RenderCallback) => ( | ||||
|         render(siteMetadata) | ||||
|       ), | ||||
|       useStaticQuery.mockReturnValue(siteMetadata) | ||||
|   | ||||
| @@ -1 +1,2 @@ | ||||
| // @flow | ||||
| export { default } from './Comments'; | ||||
|   | ||||
		Reference in New Issue
	
	Block a user