Fix typecheck.
This commit is contained in:
parent
b3dd711ea1
commit
b0750c82d9
3 changed files with 28 additions and 7 deletions
|
|
@ -2,13 +2,35 @@ import { render, screen } from '@testing-library/react'
|
|||
import { describe, it, expect } from 'vitest'
|
||||
import { MemoryRouter } from 'react-router'
|
||||
import Home from './home'
|
||||
import type { Route } from './+types/home'
|
||||
|
||||
describe('Home component', () => {
|
||||
it('should render task management interface', () => {
|
||||
const mockLoaderData = { tasks: [] }
|
||||
const mockComponentProps: Route.ComponentProps = {
|
||||
loaderData: { tasks: [] },
|
||||
params: {},
|
||||
matches: [
|
||||
{
|
||||
id: 'root',
|
||||
params: {},
|
||||
pathname: '/',
|
||||
data: undefined,
|
||||
loaderData: undefined,
|
||||
handle: undefined,
|
||||
},
|
||||
{
|
||||
id: 'routes/home',
|
||||
params: {},
|
||||
pathname: '/',
|
||||
data: { tasks: [] },
|
||||
loaderData: { tasks: [] },
|
||||
handle: undefined,
|
||||
},
|
||||
],
|
||||
}
|
||||
render(
|
||||
<MemoryRouter>
|
||||
<Home loaderData={mockLoaderData} />
|
||||
<Home {...mockComponentProps} />
|
||||
</MemoryRouter>
|
||||
)
|
||||
expect(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue