test: project-storybook coverage#1007
Conversation
Cover _open, placeholder/cover/page rendering, text wrap, fit-cover, and render_storybook_pdf edge cases including parent dir creation.
Qodo reviews are paused for this user.Troubleshooting steps vary by plan Learn more → On a Teams plan? Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center? |
|
Warning Review limit reached
More reviews will be available in 6 minutes and 16 seconds. Learn how PR review limits work. Your organization has used up its prepaid credits, and credit purchases are no longer available. Enable the review add-on in the billing tab to keep reviews running — you're only billed for reviews past your plan's rate limits ($0.25/file). ⌛ How to resolve this issue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based credits. 🚦 How do rate limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan refill rate. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, the refill rate gradually slows as usage increases. The highest same-day bursts are limited more strictly. Please see our Fair Usage Limits Policy for further information. ℹ️ Review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
✨ Finishing Touches🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
| def test_wrap_single_long_word_splits_to_one_line(): | ||
| draw = ImageDraw.Draw(Image.new("RGB", (100, 100))) | ||
| font = ImageFont.load_default() | ||
| lines = _wrap(draw, "supercalifragilistic", font, 10) | ||
| assert len(lines) == 1 | ||
| assert lines[0] == "supercalifragilistic" |
There was a problem hiding this comment.
💡 Quality: Misleading test name: _wrap does not split long words
test_wrap_single_long_word_splits_to_one_line implies that an over-long word is split, but _wrap (storybook.py:56-71) performs greedy word-wrapping only and never breaks a single word that exceeds max_w. The word is emitted whole on one line, which the assertion (lines[0] == "supercalifragilistic") correctly reflects. The name suggests behavior that doesn't occur and obscures the actual (and arguably noteworthy) limitation: a word longer than the caption band will overflow horizontally. Consider renaming to something like test_wrap_overlong_word_kept_on_single_line so the test documents the real behavior. No functional issue — tests pass and assertions are accurate.
Rename to accurately describe that an over-long word is kept whole rather than split.:
def test_wrap_overlong_word_kept_on_single_line():
draw = ImageDraw.Draw(Image.new("RGB", (100, 100)))
font = ImageFont.load_default()
lines = _wrap(draw, "supercalifragilistic", font, 10)
assert len(lines) == 1
assert lines[0] == "supercalifragilistic"
Was this helpful? React with 👍 / 👎
|
Note Your trial team has used its Gitar budget, so automatic reviews are paused. Upgrade now to unlock full capacity. Comment "Gitar review" to trigger a review manually. Code Review 👍 Approved with suggestions 0 resolved / 1 findingsIntroduces unit tests for storybook PDF assembly helpers. Rename 💡 Quality: Misleading test name: _wrap does not split long words📄 tests/test_project_storybook.py:89-94
Rename to accurately describe that an over-long word is kept whole rather than split.🤖 Prompt for agentsOptionsDisplay: compact → Showing less information. Comment with these commands to change:
Was this helpful? React with 👍 / 👎 | Gitar |
Unit tests for the project-storybook module. Tests only. Build-team card.