ai-assisted-todolist

Frontend#

cd frontend
npm run test            # Vitest
npm run test:coverage   # with the lcov report SonarCloud consumes
npm run lint            # oxlint
npm run build           # tsc -b && vite build

App.test.tsx renders the board against a stubbed fetch and checks what the user sees and does in each state: signed out, signed in, adding, completing, deleting, clearing, and each way the backend can refuse. mockApi routes on the method as well as the path, because list, create, update and delete all share the /api/tasks URL and only the method tells them apart.

Two details are deliberate:

dates.test.ts covers the due-date logic directly rather than through the DOM. It is the only pure logic in the frontend and the only place an off-by-one can hide: "Today", "Tomorrow", a weekday name and a plain date are each one day apart. It includes a daylight-saving case, because building a Date from yyyy-mm-dd at local midnight gets the answer wrong by a day across a clock change — which is why every function there takes today as an argument and anchors its arithmetic at UTC.