1
0
mirror of https://github.com/kremalicious/portfolio.git synced 2024-06-28 00:27:40 +02:00
portfolio/tests/Home.test.jsx

27 lines
649 B
React
Raw Normal View History

2019-04-28 15:01:38 +02:00
import React from 'react'
2019-05-30 22:55:12 +02:00
import { render } from '@testing-library/react'
2021-02-06 14:40:39 +01:00
import Home from '../src/pages/index'
import projects from './__fixtures__/projects.json'
import projectImageFiles from './__fixtures__/projectImageFiles.json'
2019-04-28 15:01:38 +02:00
describe('Home', () => {
const data = {
...projects,
...projectImageFiles
}
2019-05-26 22:20:16 +02:00
const pageContext = {
repos: [
{
2019-10-10 00:56:37 +02:00
name: 'hello',
full_name: 'kremalicious/hello'
2019-05-26 22:20:16 +02:00
}
]
}
2019-04-28 15:01:38 +02:00
it('renders correctly from data file values', () => {
2019-05-26 22:20:16 +02:00
const { container } = render(<Home data={data} pageContext={pageContext} />)
2019-04-28 15:01:38 +02:00
expect(container.firstChild).toBeInTheDocument()
})
})