From 49be7ffbc6116667ec608405b2d6e7c1d31e8729 Mon Sep 17 00:00:00 2001 From: Codex Review Integration Date: Wed, 16 Sep 2026 13:59:22 -0300 Subject: [PATCH] test(work-orders): avoid unsupported array at helper --- .../workorders/due-date-schedule-floor.test.tsx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/app/(protected)/workorders/due-date-schedule-floor.test.tsx b/src/test/app/(protected)/workorders/due-date-schedule-floor.test.tsx index 32c1092e..e6c41d50 100644 --- a/src/test/app/(protected)/workorders/due-date-schedule-floor.test.tsx +++ b/src/test/app/(protected)/workorders/due-date-schedule-floor.test.tsx @@ -107,14 +107,16 @@ describe("Due Date cannot be before Schedule On (SH-356)", () => { />, ); - fireEvent.click(within(rowByLabel("Due Date").parentElement!).getAllByRole("button").at(-1)!); + const dueDateButtons = within(rowByLabel("Due Date").parentElement!).getAllByRole("button"); + fireEvent.click(dueDateButtons[dueDateButtons.length - 1]); expect(await screen.findByRole("button", { name: "9" })).toBeDisabled(); fireEvent.keyDown(document.activeElement ?? document.body, { key: "Escape" }); const scheduleBlock = rowByLabel("Schedule On").parentElement!; - fireEvent.click(within(scheduleBlock).getAllByRole("button").at(-1)!); + const scheduleButtons = within(scheduleBlock).getAllByRole("button"); + fireEvent.click(scheduleButtons[scheduleButtons.length - 1]); const calendars = await screen.findAllByRole("button", { name: "15" }); - fireEvent.click(calendars.at(-1)!); + fireEvent.click(calendars[calendars.length - 1]); expect(onPatch).toHaveBeenCalledWith( expect.objectContaining({ scheduledOn: day(15), dueDate: "" }),