add unit tests with documentation for 8 previously untested components #5996
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
name: Pull Request
about: Create a pull request to improve this repository
title: "test: add unit tests with documentation for 8 previously untested components"
labels: "testing"
assignees: ""
Description
Linked issue: N/A
Problem
Several core components in the react-datepicker library lacked dedicated unit tests, making it difficult to:
The following components had no test coverage:
CalendarContainer- Accessibility wrapperClickOutsideWrapper- Click detection utilityPortal- DOM portal renderingTabLoop- Keyboard navigation managementwithFloating- Higher-Order Component for Floating UIPopperComponent- Component orchestrationMonthDropdownOptions- Month selection dropdownYear- Year picker componentChanges
Added comprehensive unit tests for 8 previously untested components:
calendar_container_test.test.tsx (78 lines)
click_outside_wrapper_test.test.tsx (252 lines)
portal_test.test.tsx (218 lines)
tab_loop_test.test.tsx (297 lines)
with_floating_test.test.tsx (226 lines)
popper_component_test.test.tsx (324 lines)
month_dropdown_options_test.test.tsx (373 lines)
year_test.test.tsx (557 lines)
Documentation improvements:
Screenshots
N/A - This PR adds test coverage only
To reviewers
@testing-library/reactand Jestyarn testTest execution:
Contribution checklist