Skip to content

[TEST] UI React: Add basic unit tests for CopyToClipboard component #71

Description

@Karel-cz

🧩 Title

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


❗ Problem Description

The current CopyToClipboard 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 CopyToClipboard component.

Tests should cover:

  • Rendering the component with default props
  • Verifying the copy action works as expected
  • Handling edge cases (e.g., empty string, long text)
  • 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/CopyToClipboard.tsx

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


✅ Expected Behavior

  • A new test file or added tests for CopyToClipboard exist.
  • All basic props and scenarios are tested.
  • Copy functionality behaves correctly.
  • 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