Skip to content

Add comprehensive unit tests for all components, pipes, directives, and interceptors#21

Open
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777677944-continue-unit-tests
Open

Add comprehensive unit tests for all components, pipes, directives, and interceptors#21
devin-ai-integration[bot] wants to merge 1 commit intomainfrom
devin/1777677944-continue-unit-tests

Conversation

@devin-ai-integration
Copy link
Copy Markdown

@devin-ai-integration devin-ai-integration Bot commented May 1, 2026

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:

  • Components (11): app, auth, header, footer, article-comment, article-list, article-meta, article-preview, favorite-button, follow-button, editor, article page, home page, profile page, profile-articles, profile-favorites, settings, list-errors
  • Pipes (2): default-image, markdown
  • Directive (1): if-authenticated
  • Interceptors (3): api, token, error

Also adds zone.js as a dev dependency (required for Angular TestBed).

Review & Testing Checklist for Human

  • Run bun run test --run to verify all 392 tests pass
  • Spot-check a few test files for reasonable coverage (e.g., home.component.spec.ts tests routing logic, error.interceptor.spec.ts tests 401 handling)
  • Verify no production code was modified (only test files + package.json/bun.lock for zone.js)

Notes

  • The attached diff from the user referenced a dark mode toggle (ThemeService), but since ThemeService doesn't exist in the repo yet, those changes were not applied
  • The ArticleListComponent mutates config objects passed via @Input() (adds limit/offset to filters). Tests account for this by checking individual properties rather than exact object equality
  • All tests follow the existing patterns established in the service spec files (zone.js imports, TestBed setup, vi mocks)

Link to Devin session: https://app.devin.ai/sessions/98d889a1e632485fae587e2692d84169
Requested by: @WesternConcrete


Open in Devin Review

…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-integration
Copy link
Copy Markdown
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 and CI monitoring

Copy link
Copy Markdown
Author

@devin-ai-integration devin-ai-integration Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Devin Review found 1 potential issue.

View 6 additional findings in Devin Review.

Open in Devin Review

Comment thread package.json
Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔴 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.
Open in Devin Review

Was this helpful? React with 👍 or 👎 to provide feedback.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

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