Fix typecheck. (#14)
All checks were successful
Check / Backend (push) Successful in 14m25s
Check / Frontend (push) Successful in 2m1s

Reviewed-on: #14
Co-authored-by: Drew Galbraith <drew@tiramisu.one>
Co-committed-by: Drew Galbraith <drew@tiramisu.one>
This commit is contained in:
Drew 2025-09-27 09:13:00 +00:00 committed by Drew
parent b3dd711ea1
commit 5fcdcef449
3 changed files with 28 additions and 7 deletions

View file

@ -74,7 +74,7 @@ jobs:
working-directory: frontend
- name: Typecheck
run: npm run typecheck || echo "Failed"
run: npm run typecheck
working-directory: frontend
- name: Test

View file

@ -10,6 +10,7 @@ import {
Paper,
Typography,
Alert,
type SelectChangeEvent,
} from '@mui/material'
import { useNavigate } from 'react-router'
import type { CreateTaskRequest, Task } from '~/types/task'
@ -134,12 +135,10 @@ export function TaskForm({
}
}
const handleStatusChange = (
e: React.ChangeEvent<{ name?: string; value: unknown }>
) => {
const handleStatusChange = (event: SelectChangeEvent<TaskStatus>) => {
setFormData(prev => ({
...prev,
status: e.target.value as TaskStatus,
status: event.target.value as TaskStatus,
}))
}

View file

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