Skip to content

Latest commit

 

History

History
9 lines (7 loc) · 1.05 KB

File metadata and controls

9 lines (7 loc) · 1.05 KB

🎯 What: Added unit tests for the generateReadmeUrl function in src/components/ReadmeCardUrlSection.tsx, which was completely untested. This is a pure function that generates README URL strings based on inputs like username, themes, layouts, and display options. Also included UI tests for the ReadmeCardUrlSection component.

📊 Coverage:

  • generateReadmeUrl: Tested base cases, edge cases (like username = undefined), proper serialization of the hide parameter (stars, forks, or both), dynamic inclusions (streak, heatmap), and custom layout processing.
  • ReadmeCardUrlSection: Covered UI interactions including state updates (changing checkboxes/selects and ensuring URL updates correctly), clipboard interactions (navigator.clipboard.writeText) handling both success and failure cases, and fallback rendering behavior.

Result: 100% statement, branch, function, and line coverage achieved for src/components/ReadmeCardUrlSection.tsx. Improved confidence in formatting rules when refactoring layout and display options logic.