Compare commits

...

2 commits

Author SHA1 Message Date
0ab7bca0e9 Try to speed up builds.
All checks were successful
Check / Backend (pull_request) Successful in 6m13s
Check / Frontend (pull_request) Successful in 2m3s
2025-09-28 03:08:08 +00:00
5fcdcef449 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>
2025-09-27 09:13:00 +00:00
3 changed files with 38 additions and 11 deletions

View file

@ -6,6 +6,12 @@ on:
pull_request:
branches: [ main ]
env:
# Should speed up builds.
CARGO_INCREMENTAL: 0
# Should reduce the size of ./target to improve cache load/store.
CARGO_PROFILE_TEST_DEBUG: 0
jobs:
check-backend:
name: Backend
@ -33,19 +39,19 @@ jobs:
run: |
# hurl needs libxml needs libclang
apt update && apt install -y clang
cargo build --tests
cargo build --tests --locked
working-directory: backend
- name: "Lint"
run: |
rustup component add clippy
cargo clippy
cargo clippy --locked
working-directory: backend
- name: "Unit Tests"
run: |
cargo test -- --skip api
cargo test --locked -- --skip api
working-directory: backend
- name: "Integration Tests"
run: cargo test --test api
run: cargo test --locked --test api
working-directory: backend
check-frontend:
@ -74,7 +80,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(