Files
PacketStation/tests/server/test_traveler_fit.py
T
spencermandClaude Opus 5.5 de5b361d85
ci / frontend (pull_request) Successful in 54s
ci / server (pull_request) Failing after 12m12s
ci / image (pull_request) Skipped
ci / e2e (pull_request) Skipped
Work-order codes no longer overlap (#42), Materials before Heat map (#44), 60 min idle for Admin and Clerical (#45)
- Traveler: each work-order line shrinks, then clips, to fit its own box; 18 pt gap between boxes
- Work orders tab: card text wraps inside the card, smaller work order, wider cards
- Packet tabs: Materials before Heat map
- Sessions: SESSION_DESK_MINUTES (60) for Admin and Clerical lock and sign-out; /me answers
  lock_minutes and the browser's idle lock follows it

Co-Authored-By: Claude Opus 5.5 <[email protected]>
2026-10-21 13:16:26 -06:00

20 lines
808 B
Python

"""Work-order text on the traveler stays inside its own box (issue #42). No database needed."""
from __future__ import annotations
def test_work_order_text_fits_its_box() -> None:
# Issue #42: long work-order text shrinks, then clips, instead of running over the next QR code
from reportlab.pdfbase.pdfmetrics import stringWidth
from packetstation.pdf.doc import font_of
from packetstation.pdf.traveler import fit_line
assert fit_line("L662001", 145, 12, bold=True) == ("L662001", 12)
for s, size, bold in [
("L662001/1-SUB-99999-EXTRA-LONG", 12, True),
("Lot 12 Seq 40 WELD-STALL-HYDROTEST-LONG-NAME", 8.5, False),
]:
text, z = fit_line(s, 145, size, bold=bold)
assert size * 0.7 <= z <= size and stringWidth(text, font_of(bold), z) <= 145