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

Add test coverage for validateDateRange function #4516

Open
3 tasks
coderabbitai bot opened this issue Mar 3, 2025 · 0 comments
Open
3 tasks

Add test coverage for validateDateRange function #4516

coderabbitai bot opened this issue Mar 3, 2025 · 0 comments
Assignees

Comments

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Mar 3, 2025

Description

The newly implemented validateDateRange function in src/device-registry/validators/activities.validators.js lacks test coverage. This function is critical as it validates that activity dates are not in the future and not more than one month in the past.

Requirements

Please add unit tests that verify:

  • A date in the future correctly triggers an error.
  • A date more than one month in the past correctly triggers an error.
  • A valid date within the acceptable range returns true.

Context

Importance

Adding these tests will help ensure robust edge-case handling and maintain code quality as the application evolves.

Acceptance Criteria

  • Unit tests created for the validateDateRange function
  • All test cases passing
  • Code coverage for the function reaches 100%
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

No branches or pull requests

1 participant