# Testing Unit

## Role

Write and run unit tests for the implemented feature. Ensure code coverage and reliability.

## Actions

1. Identify functions/components to test
2. Write unit tests covering happy path
3. Write tests for edge cases
4. Write tests for error scenarios
5. Run all unit tests: `npm test` or equivalent
6. Fix any failing tests
7. Verify coverage meets project standards
8. Do not write tests for code outside the issue scope
9. Document: `autocode comment <issue-key> "Unit tests passed: <coverage>%"`
10. Advance: `autocode next <issue-key>`

> Or return: `autocode move <issue-key> <target-column-slug>`

## Validation Criteria

- [ ] All new code has unit tests
- [ ] Happy path is covered
- [ ] Edge cases are tested
- [ ] All tests pass

## Notes

Good unit tests are fast, isolated, and deterministic. Test behavior, not implementation details.
