Skip to content

test: project-storybook coverage#1007

Merged
jaylfc merged 1 commit into
devfrom
test/project-storybook
Jun 18, 2026
Merged

test: project-storybook coverage#1007
jaylfc merged 1 commit into
devfrom
test/project-storybook

Conversation

@jaylfc

@jaylfc jaylfc commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Unit tests for the project-storybook module. Tests only. Build-team card.

Cover _open, placeholder/cover/page rendering, text wrap, fit-cover,
and render_storybook_pdf edge cases including parent dir creation.
@qodo-code-review

Copy link
Copy Markdown

Qodo reviews are paused for this user.

Troubleshooting steps vary by plan Learn more →

On a Teams plan?
Reviews resume once this user has a paid seat and their Git account is linked in Qodo.
Link Git account →

Using GitHub Enterprise Server, GitLab Self-Managed, or Bitbucket Data Center?
These require an Enterprise plan - Contact us
Contact us →

@coderabbitai

coderabbitai Bot commented Jun 18, 2026

Copy link
Copy Markdown

Warning

Review limit reached

@jaylfc, we couldn't start this review because you've reached your PR review rate limit.

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 @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

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 configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 1c72ebb6-4f32-4269-b72b-987764e533cd

📥 Commits

Reviewing files that changed from the base of the PR and between 8d1923d and 7ac1a20.

📒 Files selected for processing (1)
  • tests/test_project_storybook.py
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/project-storybook

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.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Comment on lines +89 to +94
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"

@gitar-bot gitar-bot Bot Jun 18, 2026

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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 👍 / 👎

@gitar-bot

gitar-bot Bot commented Jun 18, 2026

Copy link
Copy Markdown

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.
Learn more about usage limits

Code Review 👍 Approved with suggestions 0 resolved / 1 findings

Introduces unit tests for storybook PDF assembly helpers. Rename test_wrap_single_long_word_splits_to_one_line to reflect that the function does not actually split long words.

💡 Quality: Misleading test name: _wrap does not split long words

📄 tests/test_project_storybook.py:89-94

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"
🤖 Prompt for agents
Code Review: Introduces unit tests for storybook PDF assembly helpers. Rename `test_wrap_single_long_word_splits_to_one_line` to reflect that the function does not actually split long words.

1. 💡 Quality: Misleading test name: _wrap does not split long words
   Files: tests/test_project_storybook.py:89-94

   `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.

   Fix (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"

Options

Display: compact → Showing less information.

Comment with these commands to change:

Compact
gitar display:verbose         

Was this helpful? React with 👍 / 👎 | Gitar

@jaylfc jaylfc merged commit b6ec9a1 into dev Jun 18, 2026
8 of 9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in TinyAgentOS Roadmap Jun 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Development

Successfully merging this pull request may close these issues.

1 participant