Add comprehensive unit tests for all components, pipes, directives, and interceptors#21
Conversation
…nd interceptors - Add 24 new test files covering all previously untested code - Add zone.js dev dependency required for Angular testing - Components: article-meta, home, profile, profile-articles, profile-favorites - Pipes: default-image, markdown - Directive: if-authenticated - Interceptors: api, token, error - Total: 30 test files, 392 tests passing Co-Authored-By: Wes Convery <2wconvery@gmail.com>
🤖 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:
|
There was a problem hiding this comment.
🔴 Angular package version mismatch: @angular/core at 21.2.4 while all other @angular/ packages remain at 21.1.1*
@angular/core was upgraded to 21.2.4 but all other Angular packages (@angular/common, @angular/compiler, @angular/forms, @angular/router, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/compiler-cli, @angular/build, @angular/cli) remain at 21.1.1. Angular uses exact version peer dependencies between its packages — @angular/core@21.2.4 requires @angular/compiler: "21.2.4" (per the lockfile), but only 21.1.1 is installed. Conversely, @angular/common@21.1.1, @angular/forms@21.1.1, @angular/router@21.1.1, and @angular/platform-browser@21.1.1 all declare peerDependencies: { "@angular/core": "21.1.1" } which is violated by 21.2.4. This cross-version mismatch can cause build failures, runtime errors from internal API changes between minor versions, or subtle behavioral bugs. All @angular/* packages should be at the same version.
(Refers to line 32)
Prompt for agents
The root cause is that @angular/core was bumped to 21.2.4 (likely via Dependabot) without updating the rest of the Angular packages. All @angular/* packages must be at the same version. To fix this, either:
1. Upgrade ALL Angular packages to 21.2.4: In package.json, change @angular/animations, @angular/common, @angular/compiler, @angular/forms, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/router (in dependencies) and @angular/build, @angular/cli, @angular/compiler-cli (in devDependencies) from 21.1.1 to 21.2.4, then run bun install.
2. Or revert @angular/core back to 21.1.1 to match the other packages.
Option 1 is preferred if the intent was to upgrade Angular. After changing, verify with bun install and bun run build.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
The Angular version mismatch (@angular/core at 21.2.4 vs other packages at 21.1.1) is a pre-existing issue on main — this PR only adds zone.js as a devDependency. The version skew is not introduced by this PR.
Summary
Adds 24 new unit test files achieving comprehensive test coverage across the entire Angular application. Previously only 6 service test files existed; this PR brings the total to 30 test files with 392 passing tests.
New test coverage includes:
Also adds
zone.jsas a dev dependency (required for Angular TestBed).Review & Testing Checklist for Human
bun run test --runto verify all 392 tests passhome.component.spec.tstests routing logic,error.interceptor.spec.tstests 401 handling)Notes
ArticleListComponentmutates config objects passed via@Input()(addslimit/offsetto filters). Tests account for this by checking individual properties rather than exact object equalityLink to Devin session: https://app.devin.ai/sessions/98d889a1e632485fae587e2692d84169
Requested by: @WesternConcrete