Add unit tests for components, routes, and app config#16
Add unit tests for components, routes, and app config#16devin-ai-integration[bot] wants to merge 2 commits intomainfrom
Conversation
- app.config.spec.ts: Tests for initAuth() and window.__conduit_debug__ - app.routes.spec.ts: Tests for route definitions and guard configuration - header.component.spec.ts: Tests for auth-state-based navigation - auth.component.spec.ts: Tests for login/register form and auth service - home.component.spec.ts: Tests for feed toggling and tag filtering - article.component.spec.ts: Tests for article/comments load and CRUD - editor.component.spec.ts: Tests for create/edit article and tag management - profile.routes.spec.ts: Smoke tests for profile child routes - Add zone.js as dev dependency for test infrastructure - Update test-setup.ts with improved error handling 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:
|
Devin Review
|
There was a problem hiding this comment.
🔴 @angular/core version mismatch with all other Angular packages causes peer dependency violations
@angular/core is bumped to 21.2.4 while every other @angular/* package remains at 21.1.1. The lockfile confirms exact peer dependency requirements: @angular/common@21.1.1, @angular/forms@21.1.1, @angular/animations@21.1.1, @angular/platform-browser@21.1.1, @angular/platform-browser-dynamic@21.1.1, and @angular/router@21.1.1 all require exactly @angular/core: "21.1.1". Additionally, @angular/core@21.2.4 has a peer dependency on @angular/compiler: "21.2.4" but only @angular/compiler@21.1.1 is installed. Angular requires all @angular/* packages to be at the same version; mixing versions can cause cryptic runtime errors (DI failures, change detection issues, template compilation problems).
(Refers to line 32)
Prompt for agents
The @angular/core package was bumped to 21.2.4 (likely by Dependabot) without updating the other Angular packages. All @angular/* packages must be kept at the same version. Either revert @angular/core back to 21.1.1 to match the other packages, or update ALL Angular packages (@angular/animations, @angular/common, @angular/compiler, @angular/forms, @angular/platform-browser, @angular/platform-browser-dynamic, @angular/router, @angular/build, @angular/cli, @angular/compiler-cli) to 21.2.4 simultaneously. The relevant files are package.json and bun.lock.
Was this helpful? React with 👍 or 👎 to provide feedback.
There was a problem hiding this comment.
The @angular/core@21.2.4 version was already on the branch before this PR's changes (from the user's provided diff). This PR only added zone.js as a devDependency to package.json. The Angular version alignment is outside the scope of this test-only PR.
Co-Authored-By: Wes Convery <2wconvery@gmail.com>
Summary
Adds 8 new Vitest unit test files covering the previously identified coverage gaps: components, route definitions, app config/initializer, and profile routes. Also adds
zone.jsas a dev dependency for the test infrastructure.New test files (101 new tests):
app.config.spec.ts— TestsinitAuth()factory andwindow.__conduit_debug__debug interfaceapp.routes.spec.ts— Tests route definitions, guard configuration, and route countheader.component.spec.ts— Tests auth-state-based navigation (loading, unauthenticated, authenticated, unavailable)auth.component.spec.ts— Tests login/register form, auth service integration, error handling, and navigationhome.component.spec.ts— Tests feed toggling, tag filtering, page navigation, and auth redirectarticle.component.spec.ts— Tests article/comments loading, CRUD operations, favorite/follow togglingeditor.component.spec.ts— Tests create/edit article modes, tag management, authorization redirectprofile.routes.spec.ts— Smoke tests for profile child routes structureOther changes:
zone.js@0.16.1as a dev dependency (required by Angular TestBed infrastructure)test-setup.tswith improved error handling in try/catchAll 281 tests pass locally (14 test files, 180 existing + 101 new).
Review & Testing Checklist for Human
bun run testto verify all 281 tests passvi.fn()patternNotes
provideRouter([])instead of deprecatedRouterTestingModulefor Angular 21 compatibilityoverrideComponentto isolate the unit under testIfAuthenticatedDirectiverequiresisAuthenticatedobservable on UserService mocksLink to Devin session: https://app.devin.ai/sessions/da36386cf4eb4b16b729e7e2656f6a79
Requested by: @WesternConcrete