Skip to content

test(react): increase coverage for DatePicker#21833

Merged
riddhybansal merged 3 commits intocarbon-design-system:mainfrom
adamalston:n/a-date-picker
Apr 28, 2026
Merged

test(react): increase coverage for DatePicker#21833
riddhybansal merged 3 commits intocarbon-design-system:mainfrom
adamalston:n/a-date-picker

Conversation

@adamalston
Copy link
Copy Markdown
Contributor

No issue.

Increased test coverage for DatePicker and deleted dead code.

Changelog

Changed

  • Increased test coverage for DatePicker.

Removed

  • Deleted dead code in DatePicker.

Testing / Reviewing

I deleted dead code:

  • calendar.selectedDates comes from Flatpickr and is always an array, so if (!calendar.selectedDates) return; is redundant.
  • Two effects both clear the calendar when value is reset to an empty value. The uncovered clear appears to be redundant because the earlier effect already handles the same case.
yarn test --coverage \
  --runTestsByPath packages/react/src/components/DatePicker/DatePicker-test.js \
  --collectCoverageFrom=packages/react/src/components/DatePicker/DatePicker.tsx

PR Checklist

As the author of this PR, before marking ready for review, confirm you:

  • Reviewed every line of the diff
  • Updated documentation and storybook examples
  • Wrote passing tests that cover this change
  • Addressed any impact on accessibility (a11y)
  • Tested for cross-browser consistency
  • Validated that this code is ready for review and status checks should pass

More details can be found in the pull request guide

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 15, 2026

Deploy Preview for v11-carbon-web-components ready!

Name Link
🔨 Latest commit 3cded90
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-web-components/deploys/69e7a53e258bfe0008afbf97
😎 Deploy Preview https://deploy-preview-21833--v11-carbon-web-components.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented Mar 15, 2026

Deploy Preview for v11-carbon-react ready!

Built without sensitive environment variables

Name Link
🔨 Latest commit 3cded90
🔍 Latest deploy log https://app.netlify.com/projects/v11-carbon-react/deploys/69e7a53e8244800008bcfc62
😎 Deploy Preview https://deploy-preview-21833--v11-carbon-react.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.04%. Comparing base (0df8173) to head (3cded90).

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #21833      +/-   ##
==========================================
+ Coverage   95.01%   95.04%   +0.03%     
==========================================
  Files         538      538              
  Lines       44982    44975       -7     
  Branches     6459     6508      +49     
==========================================
+ Hits        42739    42747       +8     
+ Misses       2114     2099      -15     
  Partials      129      129              
Flag Coverage Δ
main-packages 89.12% <100.00%> (+0.09%) ⬆️
web-components 97.86% <ø> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Copy Markdown
Contributor

@heloiselui heloiselui left a comment

Choose a reason for hiding this comment

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

LGTM!

Comment thread packages/react/src/components/DatePicker/DatePicker.tsx
@riddhybansal riddhybansal added this pull request to the merge queue Apr 28, 2026
Merged via the queue into carbon-design-system:main with commit c1fdd25 Apr 28, 2026
39 checks passed
@adamalston adamalston deleted the n/a-date-picker branch April 29, 2026 01:31
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