Skip to content

[TEST] UI React: Add basic unit tests for Date component #72

Description

@Karel-cz

🧩 Title

[TEST] UI React: Add basic unit tests for Date component


❗ Problem Description

The current Date component does not have unit tests covering its basic rendering and props behavior.

This limits confidence in changes and may allow regressions to slip into production.


🎯 Goal

Create basic unit tests for the Date component.

Tests should cover:

  • Rendering the component with default props
  • Using min and max props (if implemented)
  • Handling invalid or edge-case dates
  • Ensuring correct formatting/display
  • Interaction tests (if applicable, e.g., selecting a date)
  • Snapshot testing (optional)

Reference test implementation:

react-ts-ui-lib/library/tests/ui/basic-components/block.test.tsx

Reference component:

react-ts-ui-lib/library/ui/src/basic-components/Date.tsx

Tests should be simple, reliable, and follow existing testing conventions.


✅ Expected Behavior

  • All basic props and scenarios are tested.
  • Component behaves correctly with min/max dates.
  • Tests pass successfully.
  • No regressions occur in existing functionality.
  • Coverage improves for the component.

📌 Before submitting

Please make sure to:

  • Star ⭐ the repository, as it will help make your work more visible
  • Synchronize your fork with the latest version of the code
  • Describe in at least one sentence what you did and how
  • Ensure all tests pass
  • Follow existing testing conventions and structure

Metadata

Metadata

Assignees

Labels

TESTAdded or improve tests.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions