PR 6/6: React Migration — Testing & Cleanup#47
Open
devanshi-gpta wants to merge 1 commit into
Open
Conversation
- 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 EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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 persistenceutils.test.ts—defaultImagefallback behavior,formatDateformattingcomponents.test.tsx—ListErrorsnull/render cases,Footerrendering with yearAuthContext.test.tsx— unauthenticated (no token), authenticated (valid token), purge on 401Test infrastructure:
test-setup-react.ts—@testing-library/jest-dom/vitestmatchers +window.matchMediamockvitest.config.ts— React plugin,globals: true, jsdom environment, targetssrc/__tests__/Angular removal (72 files changed, net -5250 lines):
angular.json,tsconfig.app.json,tsconfig.spec.json,src/app/,src/main.ts,src/test-setup.ts@angular/*,rxjs,tslib,@rx-angular/*,@analogjs/vite-plugin-angular,@angular/build,@angular/cli,@angular/compiler-clitsconfig.jsonwith project-references totsconfig.react.json+tsconfig.node.jsonPackage.json updates:
conduit-react, version 1.0.0, added"type": "module"dev→ vite,build→ tsc + vite build,preview→ vite previewngand Angular-specific scriptsbun run build && bun run testboth pass with zero Angular remnants.Link to Devin session: https://app.devin.ai/sessions/6215127f80d4463cad3055cf81b87f0c
Requested by: @devanshi-gpta
Devin Review