Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions pr_description.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
🎯 **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.
Comment thread
is0692vs marked this conversation as resolved.
Loading
Loading