mirror of
https://github.com/kremalicious/portfolio.git
synced 2024-12-22 01:03:20 +01:00
fix test
This commit is contained in:
parent
9705015d69
commit
5a2f2478c9
@ -1,4 +1,4 @@
|
||||
import { render } from '@testing-library/react'
|
||||
import { render, screen } from '@testing-library/react'
|
||||
import projectsMock from '../../../tests/__fixtures__/projects.json'
|
||||
import reposMock from '../../../tests/__fixtures__/repos.json'
|
||||
import Page from '../page'
|
||||
@ -14,5 +14,8 @@ jest.mock('../../lib/github', () => ({
|
||||
describe('app: /page', () => {
|
||||
it('renders correctly', async () => {
|
||||
render(await Page())
|
||||
|
||||
const location = await screen.findByText('Lisbon')
|
||||
expect(location).toBeInTheDocument()
|
||||
})
|
||||
})
|
||||
|
@ -21,7 +21,7 @@ const customJestConfig: Config = {
|
||||
collectCoverageFrom: [
|
||||
'src/**/*.{ts,tsx}',
|
||||
'!src/**/*.{stories,test}.{ts,tsx}',
|
||||
'!src/@types/**/*.{ts,tsx}'
|
||||
'!src/types/**/*.{ts,tsx}'
|
||||
],
|
||||
// note: this does not work with Next.js, hence workaround further down
|
||||
// see: https://github.com/vercel/next.js/issues/35634#issuecomment-1115250297
|
||||
|
@ -13,7 +13,8 @@ jest.mock('../src/app/actions', () => ({
|
||||
getLocation: jest.fn().mockImplementation(() => dataLocation),
|
||||
getRandomGif: jest
|
||||
.fn()
|
||||
.mockImplementation(() => giphy.data.images.original.mp4)
|
||||
.mockImplementation(() => giphy.data.images.original.mp4),
|
||||
preloadLocation: jest.fn()
|
||||
}))
|
||||
|
||||
const unmockedFetch = global.fetch
|
||||
|
Loading…
Reference in New Issue
Block a user