Skip to content

feat: TDD migration of owners/pets/visits from Angular to React 18#42

Open
devin-ai-integration[bot] wants to merge 5 commits into
mainfrom
devin/1780442014-react-migration-tdd
Open

feat: TDD migration of owners/pets/visits from Angular to React 18#42
devin-ai-integration[bot] wants to merge 5 commits into
mainfrom
devin/1780442014-react-migration-tdd

Conversation

@devin-ai-integration

@devin-ai-integration devin-ai-integration Bot commented Jun 2, 2026

Copy link
Copy Markdown
Contributor

Summary

Test-driven migration of the three interconnected modules (owners, pets, visits) from Angular 16 to React 18 + TypeScript + Vite, living in react-frontend/.

Commit sequence follows Red→Green TDD:

  1. docs/API_CONTRACT.md — documents every REST endpoint (method, URL, shapes, errors) derived from the Angular services
  2. 25 RTL + MSW tests written first against the contract (Red phase)
  3. React components + shared api.ts service implemented to pass all tests (Green phase)

Key patterns per AGENTS.md:

  • Single axios instance in src/services/api.ts with baseURL: http://localhost:9966/petclinic/api
  • Error handling with dismissable alerts on every API call
  • Loading states gating empty-state messages
  • Form validation with aria-describedby error association
  • MSW handlers use :ownerId, :petId, :visitId route params and return 204 No Content for DELETEs

npm run build (tsc + vite build) and npx vitest run both pass cleanly.

Link to Devin session: https://partner-workshops.devinenterprise.com/sessions/9ec58397515f4e96bfb07363545bb706
Requested by: @DhrovS


Open in Devin Review

Tests import components that don't exist yet - expected to fail.
Validates owner CRUD, pet management, and visit creation against API contract.
… phase)

- Shared API service with axios (baseURL: http://localhost:9966/petclinic/api)
- Owner CRUD: list, detail, add, edit with search
- Pet management: list, add, edit, delete
- Visit creation: add visit to a pet
- All 25 RTL+MSW tests passing
- npm run build passes
- Follows AGENTS.md coding standards (error handling, loading states, a11y)
@devin-ai-integration

Copy link
Copy Markdown
Contributor Author

🤖 Devin AI Engineer

I'll be helping with this pull request! Here's what you should know:

✅ I will automatically:

  • Address comments on this PR. Add '(aside)' to your comment to have me ignore it.
  • Look at CI failures and help fix them

Note: I can only respond to comments from users who have write access to this repository.

⚙️ Control Options:

  • Disable automatic comment, CI, and merge conflict monitoring

devin-ai-integration[bot]

This comment was marked as resolved.

- Remove shared mutable state in MSW handlers (use per-test override)
- Remove pets:[] from owner update payload (prevents data loss)
- Gate empty-state messages behind !error in OwnerList, PetList, VisitList
devin-ai-integration[bot]

This comment was marked as resolved.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant