diff --git a/frontend/src/components/modals/ConfirmBuyModal.jsx b/frontend/src/components/modals/ConfirmBuyModal.jsx index 5036d8c..0cfadf0 100644 --- a/frontend/src/components/modals/ConfirmBuyModal.jsx +++ b/frontend/src/components/modals/ConfirmBuyModal.jsx @@ -131,6 +131,7 @@ export default function ConfirmBuyModal({ onClick={handleDecrement} className="confirm-buy-counter-btn" disabled={quantity <= 1 || isSubmitting} + aria-label="Decrease quantity" > - @@ -139,12 +140,14 @@ export default function ConfirmBuyModal({ value={quantity} readOnly className="confirm-buy-counter-display" + aria-label="Quantity to mark bought" /> diff --git a/frontend/tests/location-map-manager.spec.ts b/frontend/tests/location-map-manager.spec.ts index 8b2e1a4..cb71d68 100644 --- a/frontend/tests/location-map-manager.spec.ts +++ b/frontend/tests/location-map-manager.spec.ts @@ -3689,9 +3689,9 @@ test("viewer advances map buy modal after partial quantity buys", async ({ page await page.getByRole("button", { name: "Mark flour bought" }).click(); await expect(page.locator(".confirm-buy-item-name")).toHaveText("flour"); - await page.locator(".confirm-buy-counter-btn").first().click(); - await page.locator(".confirm-buy-counter-btn").first().click(); - await expect(page.locator(".confirm-buy-counter-display")).toHaveValue("1"); + await page.getByRole("button", { name: "Decrease quantity" }).click(); + await page.getByRole("button", { name: "Decrease quantity" }).click(); + await expect(page.getByRole("spinbutton", { name: "Quantity to mark bought" })).toHaveValue("1"); await page.getByRole("button", { name: "Mark as Bought" }).click(); await expect.poll(() => boughtPayloads.length).toBe(1);