From b4fdd7abb86e10fe8fb90c23c2a4c6d4c3e05a2a Mon Sep 17 00:00:00 2001 From: devops Date: Sat, 17 Oct 2026 15:27:07 +0000 Subject: [PATCH] fix(contact): add standard autocomplete, inputmode and attributes for contact inputs --- .../application/components/ContactFormClient.tsx | 7 ++++++- .../components/__tests__/ContactFormClient.test.tsx | 13 +++++++++++++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/frontend/application/components/ContactFormClient.tsx b/frontend/application/components/ContactFormClient.tsx index 43d83cd6..0cfbe5b3 100644 --- a/frontend/application/components/ContactFormClient.tsx +++ b/frontend/application/components/ContactFormClient.tsx @@ -150,7 +150,9 @@ export default function ContactFormClient() { setName(e.target.value)} className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-2xl p-4 text-sm font-bold focus:outline-none focus:ring-2 focus:ring-canina-blue/20" @@ -162,7 +164,10 @@ export default function ContactFormClient() { setPhone(e.target.value)} className="w-full bg-medical-gray-50 border border-medical-gray-200 rounded-2xl p-4 text-sm font-bold text-left focus:outline-none focus:ring-2 focus:ring-canina-blue/20" diff --git a/frontend/application/components/__tests__/ContactFormClient.test.tsx b/frontend/application/components/__tests__/ContactFormClient.test.tsx index 81c379e2..4d6c7403 100644 --- a/frontend/application/components/__tests__/ContactFormClient.test.tsx +++ b/frontend/application/components/__tests__/ContactFormClient.test.tsx @@ -131,4 +131,17 @@ describe("ContactFormClient Component", () => { expect(screen.getByText("خطا در سرور، لطفاً بعداً تلاش کنید.")).toBeInTheDocument(); }); }); + + it("provides standard autocomplete and inputmode attributes on contact inputs", () => { + vi.mocked(api.get).mockResolvedValueOnce({ data: [] }); + render(); + + const nameInput = document.getElementById("contact-name"); + const phoneInput = document.getElementById("contact-phone"); + + expect(nameInput).toHaveAttribute("autocomplete", "name"); + expect(phoneInput).toHaveAttribute("autocomplete", "tel"); + expect(phoneInput).toHaveAttribute("inputmode", "tel"); + }); + });