Skip to content

test: add tests for integrate onboarding form#1143

Merged
iamitprakash merged 1 commit intofeat/integrate-onboarding-formfrom
test/integrate-onboarding-form
Jan 31, 2026
Merged

test: add tests for integrate onboarding form#1143
iamitprakash merged 1 commit intofeat/integrate-onboarding-formfrom
test/integrate-onboarding-form

Conversation

@MayankBansal12
Copy link
Member

@MayankBansal12 MayankBansal12 commented Jan 31, 2026

Date: 31-01-26

Developer Name: @MayankBansal12


Issue Ticket Number:-

Description:

  • Add tests for new stepper (create application)
  • Add tests for status card (tracka application)

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

@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

Walkthrough

This PR introduces safer JSON parsing for step data retrieval by adding a safeParse utility function with error handling. The component is refactored to use this utility, and comprehensive integration tests are added for NewStepper and StatusCard components covering submission flows, error handling, and localStorage cleanup.

Changes

Cohort / File(s) Summary
Storage Utility Enhancement
app/utils/storage.js
Added new safeParse(key) function that wraps JSON.parse in try-catch, returning an empty object on parse failure for safer localStorage value retrieval.
Component Refactoring
app/components/new-join-steps/new-step-six.js
Replaced five inline JSON.parse calls with safer safeParse() utility in loadAllStepData, improving error resilience without changing control flow.
NewStepper Integration Tests
tests/integration/components/new-stepper-test.js
Expanded test coverage significantly with mocked services (router, toast), step data fixtures, and new test scenarios including submission flow (step 6), error handling (409 conflict, API errors, network failures), localStorage cleanup verification, and data aggregation assertions.
StatusCard Integration Tests
tests/integration/components/status-card-test.js
Enhanced tests with helper functions, router/onboarding service stubs, and new test module for track application button behavior including navigation verification and missing data handling.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

🐰 A safer parse, no crashes in sight,
JSON wrapped tight in a try-catch delight,
Tests multiply with each step we take,
From storage to router, no errors we make!
The stepper now stronger, the step-six so bright! ✨

🚥 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 title 'test: add tests for integrate onboarding form' accurately reflects the main objective of the pull request: adding tests for the onboarding form components (new stepper and status card).
Description check ✅ Passed The PR description directly aligns with the changeset—it documents adding tests for the new stepper (create application) and status card (track application), which matches the test file modifications and utility refactoring included.

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

✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch test/integrate-onboarding-form

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/integrate-onboarding-form January 31, 2026 15:36
@MayankBansal12
Copy link
Member Author

@coderabbitai review bro

@coderabbitai
Copy link

coderabbitai bot commented Jan 31, 2026

@MayankBansal12: I'll review the changes in this PR for you! 🔍

✅ Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Fix all issues with AI agents
In `@tests/integration/components/new-stepper-test.js`:
- Around line 9-12: The forEach callbacks in this test file (notably in the
clearAllStepData function that iterates STEP_DATA_STORAGE_KEY and the other
forEach usages in the same file) use expression-bodied arrow callbacks which
implicitly return values and trigger Biome errors; change those callbacks to use
block bodies instead (e.g., replace single-expression arrow callbacks with
braces and a statement body so they do not return a value), updating
clearAllStepData and the other forEach occurrences to use block-bodied callbacks
that call localStorage.removeItem(...) within { }.

@iamitprakash iamitprakash merged commit 0c4f0c4 into feat/integrate-onboarding-form Jan 31, 2026
4 checks passed
@iamitprakash iamitprakash deleted the test/integrate-onboarding-form branch January 31, 2026 20:20
iamitprakash pushed a commit that referenced this pull request Jan 31, 2026
* feat: integrate create application API

* feat: add tracking button for pending application

* fix: update values for create application request

* test: add tests for new stepper and track application (#1143)
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.

3 participants