Summary
Add focused test coverage for the useNotes React hook.
This repo already has one hook test file for useActivityGraph, but useNotes has meaningful state transitions and no tests. That makes it a good 1-2 hour exercise: contained logic, clear inputs, and obvious validation.
Current State
Relevant files:
src/move37/sdk/node/src/hooks/useNotes.js
src/move37/sdk/node/src/hooks/useActivityGraph.test.jsx
useNotes currently handles:
- initial note loading
createNote(...)
updateNote(...)
importTxtNotes(...)
- error state management
None of that is currently covered by tests.
Acceptance Criteria
- Add a test showing the hook loads notes on mount.
- Add a test showing
createNote(...) inserts or prepends the returned note into local state.
- Add a test showing
updateNote(...) replaces the existing note entry rather than duplicating it.
- Add a test showing
importTxtNotes(...) adds imported notes to local state.
- Add at least one error-path test showing the hook exposes an
Error instance when the request fails.
- Follow the existing test style used in
useActivityGraph.test.jsx.
Non-Goals
- Do not refactor the hook implementation unless needed to make the tests pass.
- Do not add a new hook abstraction layer.
- Do not modify the backend for this issue.
Validation
Run:
cd src/move37/sdk/node
npm test
Please keep the tests readable. This issue is meant to reveal whether the candidate can use an agent for speed without outsourcing basic judgment about state transitions.
Summary
Add focused test coverage for the
useNotesReact hook.This repo already has one hook test file for
useActivityGraph, butuseNoteshas meaningful state transitions and no tests. That makes it a good 1-2 hour exercise: contained logic, clear inputs, and obvious validation.Current State
Relevant files:
src/move37/sdk/node/src/hooks/useNotes.jssrc/move37/sdk/node/src/hooks/useActivityGraph.test.jsxuseNotescurrently handles:createNote(...)updateNote(...)importTxtNotes(...)None of that is currently covered by tests.
Acceptance Criteria
createNote(...)inserts or prepends the returned note into local state.updateNote(...)replaces the existing note entry rather than duplicating it.importTxtNotes(...)adds imported notes to local state.Errorinstance when the request fails.useActivityGraph.test.jsx.Non-Goals
Validation
Run:
Please keep the tests readable. This issue is meant to reveal whether the candidate can use an agent for speed without outsourcing basic judgment about state transitions.