diff --git a/.forgejo/workflows/ci.yml b/.forgejo/workflows/ci.yml index 3207491..27acecc 100644 --- a/.forgejo/workflows/ci.yml +++ b/.forgejo/workflows/ci.yml @@ -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 diff --git a/frontend/app/components/TaskForm.tsx b/frontend/app/components/TaskForm.tsx index 8da2698..74692b2 100644 --- a/frontend/app/components/TaskForm.tsx +++ b/frontend/app/components/TaskForm.tsx @@ -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) => { setFormData(prev => ({ ...prev, - status: e.target.value as TaskStatus, + status: event.target.value as TaskStatus, })) } diff --git a/frontend/app/routes/home.test.tsx b/frontend/app/routes/home.test.tsx index 3c7ed84..f4fd844 100644 --- a/frontend/app/routes/home.test.tsx +++ b/frontend/app/routes/home.test.tsx @@ -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( - + ) expect(