Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/day picker/update test #37

Merged
merged 11 commits into from
Dec 2, 2024
Merged

Conversation

thevuong
Copy link
Contributor

@thevuong thevuong commented Dec 2, 2024

No description provided.

Changed color variables across multiple components and styles to use a consistent naming convention with the "color-" prefix. This improves readability and maintainability of the code, ensuring consistent usage of color variables throughout the project. The update affects chart components, sidebar components, and Tailwind configuration.
The test script in both the day-picker and hooks packages has been updated to use `vitest run` instead of `vitest --watch=false`. This ensures that tests are executed properly without watch mode, aligning with standard usage and improving script reliability.
Ensure consistent test outcomes by establishing a fixed date for the test environment. Implemented date changes in `single-required` and `modifiers-selected` test cases to prevent flaky tests due to varying system dates.
Add startMonth and endMonth props to restrict date pickers to specific months. The `useGetModifiers` function now handles these new props, ensuring days outside the specified range are considered hidden. Included tests verify the correct behavior for days before the start or after the end of the specified months.
Replace variable-based day cell dimensions with fixed values to ensure consistent sizing. This update resolves layout issues when variables are not defined.
Introduce a focus-visible outline to the day-picker dropdown for improved accessibility. This change helps users navigate more easily by providing a clear visual indicator when the dropdown is focused. Adjusted related components to ensure consistent styling across the application.
Implement support for the broadcast calendar in the day-picker component, allowing weeks to align with broadcast calendar standards. Introduce the `broadcastCalendar` prop to toggle this functionality, with corresponding logic to compute week start and end dates. This update includes new utility functions, tests, and enhanced styling to accommodate broadcast calendar specifics.
Consolidate month and year change handlers into reusable functions. This reduces code duplication and enhances maintainability by creating a single implementation for handling both actions outside the rendering loop.
Refactor the code to consistently use the 'gridcell' role instead of 'cell' for querying date elements across all test files and components. This change aligns with ARIA practices and ensures accurate role usage within the DayPicker components. Additionally, enhance accessibility by adding 'aria-label' and 'role' properties to the container elements, and prevent rendering issues by checking the 'hidden' modifier for non-interactive days.
Reformat the CSS variable declarations in the day-picker component for improved readability and consistency. Comments explaining each variable have been reformatted for clarity, ensuring easier maintenance and understanding of the code. This change does not affect any functionality.
Change test file import paths to use absolute paths for consistency and maintainability. This approach enhances code readability and avoids potential path resolution issues. The configuration files were updated to support the use of these absolute paths.
@thevuong thevuong merged commit 51b29c9 into main Dec 2, 2024
1 check passed
@thevuong thevuong deleted the feature/day-picker/update-test branch December 2, 2024 07:03
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