Skip to content

test: add unit and integration tests for application detail page#1137

Merged
iamitprakash merged 4 commits intofeat/application-detailfrom
test/application-detail
Jan 20, 2026
Merged

test: add unit and integration tests for application detail page#1137
iamitprakash merged 4 commits intofeat/application-detailfrom
test/application-detail

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Jan 19, 2026

Date: 19-01-26

Developer Name: @MayankBansal12


Issue Ticket Number:-

Description:

Is Under Feature Flag

  • Yes
  • No

Database changes

  • Yes
  • No

Breaking changes (If your feature is breaking/missing something please mention pending tickets)

  • Yes
  • No

Is Development Tested?

  • Yes
  • No

Tested in staging?

  • Yes
  • No

Add relevant Screenshot below ( e.g test coverage etc. )

tests image image image

@coderabbitai
Copy link

coderabbitai bot commented Jan 19, 2026

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Walkthrough

Introduces a new application detail view with six reusable UI components (DetailHeader, FeedbackCard, InfoCard, SocialLinkPill, StatusBadge) for rendering applicant profiles. Updates the detail route, controller, and template to fetch and display application data with admin-specific UI variants. Includes constants for status/social mappings and comprehensive unit tests.

Changes

Cohort / File(s) Summary
New Application Detail Components
app/components/application/detail-header.hbs, app/components/application/detail-header.js
DetailHeader component renders profile image, name, role, location, skills, social links, score, and admin/applicant-specific action buttons with nudge cooldown logic
Supporting Detail Components
app/components/application/feedback-card.hbs, app/components/application/feedback-card.js, app/components/application/info-card.hbs, app/components/application/social-link-pill.hbs, app/components/application/social-link-pill.js, app/components/application/status-badge.hbs, app/components/application/status-badge.js
Five presentational components: FeedbackCard (displays review feedback with formatted dates), InfoCard (renders grid/block layout sections), SocialLinkPill (renders clickable social media links with icon mapping), StatusBadge (displays application status with dynamic styling)
Route & Controller Logic
app/routes/applications/detail.js, app/controllers/applications/detail.js, app/templates/applications/detail.hbs
Route refactored to fetch both application and currentUser data, returning consistent object shape on all paths. Controller adds getters for admin/applicant checks, access control, and section formatting. Template restructured to component-driven detail layout with conditional admin messaging and feedback history section
Constants & Mappings
app/constants/applications.js
Exports mapApplicationStatus, mapSocialIcons, mapSocialUrls, and adminMessage() helper for status-to-message translation
Asset Path Updates
app/components/header.hbs, app/components/scroll-to-top.hbs
Fixed relative image paths to absolute paths (e.g., assets/ to /assets/)
Test Infrastructure
tests/constants/application-data.js, tests/unit/controllers/applications/detail-test.js, tests/unit/routes/applications/detail-test.js
Added APPLICATIONS_DATA mock constant and comprehensive unit tests for controller getters (isAdmin, isApplicant, canAccessApplication, aboutYouSections) and route model transformation with error scenarios

Sequence Diagram

sequenceDiagram
    participant Client
    participant Route
    participant API
    participant Controller
    participant Template

    Client->>Route: Navigate to /applications/:id
    Route->>Route: model()
    Route->>API: GET /self/user/profile
    API-->>Route: currentUser data
    Route->>API: GET /applications/:id
    API-->>Route: application data
    Route->>Route: Return { application, currentUser }
    Route->>Controller: Pass model
    Controller->>Controller: Compute isAdmin, canAccessApplication
    Controller->>Controller: Derive aboutYouSections, hasFeedback
    Template->>Template: Render DetailHeader (if canAccessApplication)
    Template->>Template: Render admin messaging (if isAdmin)
    Template->>Template: Render InfoCard + FeedbackCard sections
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Suggested reviewers

  • Hariom01010
  • iamitprakash

Poem

🐰 New components sprout and bloom so bright,
DetailHeader, SocialPill, StatusBadge—what a sight!
Routes refactored, controllers refined with care,
Admin views and feedback loops everywhere.
Tests comprehensive, the path now clear,
Application profiles are ready to cheer! 🎉

🚥 Pre-merge checks | ✅ 2 | ❌ 1
❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The PR title accurately describes the main additions: unit tests for application detail routes and controllers. It aligns with the actual changes in the test files and the refactored route/controller logic.
Description check ✅ Passed The description is related to the changeset, mentioning unit tests for application detail controllers and route tests. It provides context about the issue ticket, testing status, and feature flag information relevant to the changes.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@MayankBansal12 MayankBansal12 changed the base branch from develop to feat/application-detail January 19, 2026 13:07
@cloudflare-workers-and-pages
Copy link

cloudflare-workers-and-pages bot commented Jan 19, 2026

Deploying www-rds with  Cloudflare Pages  Cloudflare Pages

Latest commit: 9853db0
Status: ✅  Deploy successful!
Preview URL: https://a2d785c6.www-rds.pages.dev
Branch Preview URL: https://test-application-detail.www-rds.pages.dev

View logs

@MayankBansal12 MayankBansal12 force-pushed the feat/application-detail branch from 85a3d59 to 2aa61dd Compare January 19, 2026 14:25
@MayankBansal12 MayankBansal12 force-pushed the test/application-detail branch from 7e85e38 to 8e0d33f Compare January 19, 2026 15:27
@MayankBansal12 MayankBansal12 changed the title test: add unit tests for application detail routes and controllers test: add unit and integration tests for application detail page Jan 19, 2026
@iamitprakash iamitprakash merged commit 3bea898 into feat/application-detail Jan 20, 2026
4 checks passed
@iamitprakash iamitprakash deleted the test/application-detail branch January 20, 2026 18:59
iamitprakash pushed a commit that referenced this pull request Jan 20, 2026
* feat: add application detail page

* refactor: remove unused getters, simplify info card section

* fix: incorrect usage of lastNudge and invalid linkedin url

* test: add unit and integration tests for application detail page (#1137)

* test: add unit tests for routes and controllers for detail page

* test: add integration tests for application components

* fix: add more expectation and cleanup tests

* refactor: use constants for applications data
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.

4 participants