fix(web): make printed cut instructions legible
Build CutList image / build-and-push (push) Successful in 19s
Build CutList image / build-and-push (push) Successful in 19s
Keep part numbers and their dividers visible in monochrome print output, and include the selected cutting tool and kerf on the printed report.
This commit is contained in:
@@ -33,6 +33,15 @@ class CutBadgeFormatTests(unittest.TestCase):
|
||||
self.assertIn('.cut-part-badge-length {', css)
|
||||
self.assertIn('background-color: #4c6680;', css)
|
||||
|
||||
def test_printed_cut_badges_keep_part_numbers_and_separators_legible(self) -> None:
|
||||
report_css = (REPO_ROOT / "CutList.Web/wwwroot/css/report.css").read_text()
|
||||
print_styles = report_css[report_css.index("@media print {"):]
|
||||
|
||||
self.assertIn(".cut-part-badge {", print_styles)
|
||||
self.assertIn("color: #000 !important;", print_styles)
|
||||
self.assertIn(".cut-part-badge-divider {", print_styles)
|
||||
self.assertIn("border-left: 1px solid #000 !important;", print_styles)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
@@ -45,6 +45,18 @@ class JobResultsActionsTests(unittest.TestCase):
|
||||
self.assertIn("background: transparent !important;", print_styles)
|
||||
self.assertIn("box-shadow: none !important;", print_styles)
|
||||
|
||||
def test_print_report_shows_the_selected_cutting_method_and_kerf(self) -> None:
|
||||
markup = JOB_EDITOR.read_text()
|
||||
results_start = markup.index("private RenderFragment RenderResultsTab()")
|
||||
summary_start = markup.index('<div class="row mb-4 print-summary">', results_start)
|
||||
material_list_start = markup.index('<!-- Material List:', summary_start)
|
||||
report_summary = markup[summary_start:material_list_start]
|
||||
|
||||
self.assertIn('class="print-cut-method"', report_summary)
|
||||
self.assertIn("<strong>Cut Method:</strong>", report_summary)
|
||||
self.assertIn("@job.CuttingTool.Name", report_summary)
|
||||
self.assertIn("Kerf:", report_summary)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
unittest.main()
|
||||
|
||||
Reference in New Issue
Block a user