From 34c9b775013d69dca78bab206fdeddf3841db61a Mon Sep 17 00:00:00 2001 From: AJ Isaacs Date: Sun, 2 Aug 2026 21:19:36 +0000 Subject: [PATCH] fix(web): place lock action in results toolbar --- CutList.Web/Components/Pages/Jobs/Edit.razor | 20 ++++++++-------- tests/test_job_results_actions.py | 25 ++++++++++++++++++++ 2 files changed, 35 insertions(+), 10 deletions(-) create mode 100644 tests/test_job_results_actions.py diff --git a/CutList.Web/Components/Pages/Jobs/Edit.razor b/CutList.Web/Components/Pages/Jobs/Edit.razor index a284727..7daaca6 100644 --- a/CutList.Web/Components/Pages/Jobs/Edit.razor +++ b/CutList.Web/Components/Pages/Jobs/Edit.razor @@ -987,6 +987,16 @@ else + @if (!job.IsLocked) + { + + } } @if (job.OptimizedAt.HasValue) { @@ -1050,16 +1060,6 @@ else { Job Locked } - else - { - - }
@if (summary.TotalToBePurchasedBins == 0) diff --git a/tests/test_job_results_actions.py b/tests/test_job_results_actions.py new file mode 100644 index 0000000..db720b3 --- /dev/null +++ b/tests/test_job_results_actions.py @@ -0,0 +1,25 @@ +"""Focused regression checks for job-level actions on the Results tab.""" + +from __future__ import annotations + +import unittest +from pathlib import Path + +REPO_ROOT = Path(__file__).resolve().parents[1] +JOB_EDITOR = REPO_ROOT / "CutList.Web/Components/Pages/Jobs/Edit.razor" + + +class JobResultsActionsTests(unittest.TestCase): + def test_lock_job_is_in_the_results_action_row_before_result_cards(self) -> None: + markup = JOB_EDITOR.read_text() + results_start = markup.index("private RenderFragment RenderResultsTab()") + result_cards_start = markup.index("@if (packResult != null && summary != null)", results_start) + action_row = markup[results_start:result_cards_start] + + self.assertIn('@onclick="PrintReport"', action_row) + self.assertIn('@onclick="LockJob"', action_row) + self.assertIn("Lock Job", action_row) + + +if __name__ == "__main__": + unittest.main()