From 9f5e33229324eabc2e33455c5600af7880ebbae3 Mon Sep 17 00:00:00 2001 From: Maurice Date: Sun, 27 Sep 2026 21:06:02 +0200 Subject: [PATCH] test(reservations): pick the confirm button without Array.at, which the ES2020 lib lacks --- client/src/components/Planner/ReservationsPanel.test.tsx | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/client/src/components/Planner/ReservationsPanel.test.tsx b/client/src/components/Planner/ReservationsPanel.test.tsx index 5942d16c5..f8681567d 100644 --- a/client/src/components/Planner/ReservationsPanel.test.tsx +++ b/client/src/components/Planner/ReservationsPanel.test.tsx @@ -34,7 +34,10 @@ const defaultProps = { }; /** The question a delete asks sits in its own portal; its Delete is the last one on the page. */ -const confirmDeleteButton = () => screen.getAllByRole('button', { name: 'Delete' }).at(-1)!; +const confirmDeleteButton = () => { + const buttons = screen.getAllByRole('button', { name: 'Delete' }); + return buttons[buttons.length - 1]; +}; /** A card's head band carries its own Edit and Delete, named by their tooltips. */ const cardAction = (title: string, name: 'Edit' | 'Delete') =>