Skip to content

PR 6/6: React Migration — Testing & Cleanup#47

Open
devanshi-gpta wants to merge 1 commit into
react-migration/pwa-and-analyticsfrom
react-migration/testing-and-cleanup
Open

PR 6/6: React Migration — Testing & Cleanup#47
devanshi-gpta wants to merge 1 commit into
react-migration/pwa-and-analyticsfrom
react-migration/testing-and-cleanup

Conversation

@devanshi-gpta

@devanshi-gpta devanshi-gpta commented Jun 24, 2026

Copy link
Copy Markdown

Summary

Final PR in the 6-part Angular→React migration. Adds React unit tests and removes all Angular source, config, and dependencies.

Tests (17 passing):

  • api.test.ts — Authorization header injection, error normalization, articles URL building, auth token persistence
  • utils.test.tsdefaultImage fallback behavior, formatDate formatting
  • components.test.tsxListErrors null/render cases, Footer rendering with year
  • AuthContext.test.tsx — unauthenticated (no token), authenticated (valid token), purge on 401

Test infrastructure:

  • test-setup-react.ts@testing-library/jest-dom/vitest matchers + window.matchMedia mock
  • vitest.config.ts — React plugin, globals: true, jsdom environment, targets src/__tests__/

Angular removal (72 files changed, net -5250 lines):

  • Deleted: angular.json, tsconfig.app.json, tsconfig.spec.json, src/app/, src/main.ts, src/test-setup.ts
  • Removed deps: @angular/*, rxjs, tslib, @rx-angular/*, @analogjs/vite-plugin-angular, @angular/build, @angular/cli, @angular/compiler-cli
  • Replaced root tsconfig.json with project-references to tsconfig.react.json + tsconfig.node.json

Package.json updates:

  • Renamed to conduit-react, version 1.0.0, added "type": "module"
  • Scripts: dev → vite, build → tsc + vite build, preview → vite preview
  • Removed ng and Angular-specific scripts

bun run build && bun run test both pass with zero Angular remnants.

Link to Devin session: https://app.devin.ai/sessions/6215127f80d4463cad3055cf81b87f0c
Requested by: @devanshi-gpta


Devin Review

Status Commit
⚪ Not started

Run Devin Review

Open in Devin Review (Staging)

- Add Vitest tests for React components:
  - api.test.ts: Authorization header, error handling, articles/auth endpoints
  - utils.test.ts: defaultImage, formatDate utility functions
  - components.test.tsx: ListErrors, Footer rendering
  - AuthContext.test.tsx: unauthenticated/authenticated/purge states
- Create test-setup-react.ts with jest-dom matchers and matchMedia mock
- Update vitest.config.ts for React (replace Angular plugin)
- Delete ALL Angular files:
  - Config: angular.json, tsconfig.app.json, tsconfig.spec.json
  - Source: src/app/, src/main.ts, src/test-setup.ts
  - Dependencies: remove all @angular/*, rxjs, tslib, @rx-angular/*,
    @analogjs/vite-plugin-angular, @angular/build, @angular/cli,
    @angular/compiler-cli
- Update package.json: rename to conduit-react, add type:module,
  replace ng scripts with vite scripts (dev, build, preview)
- Update tsconfig.json to reference split configs
- 17 tests pass, build succeeds, no Angular remnants

Co-Authored-By: Devanshi Gupta <devanshi.gupta@cognition.ai>
@devin-ai-integration

Copy link
Copy Markdown

🤖 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

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