fix(a11y): label catalog search controls
Deploy Canina / deploy (push) Successful in 2m10s

This commit is contained in:
devops committed 2026-10-16 20:41:53 +00:00
1 parent 4393de5d8f
commit 1aad481930
2 files changed
+11

No files matched your search

@@ -705,6 +705,7 @@ export default function ArchivePage({
<div className="relative mb-3">
<input
type="text"
aria-label="جستجوی علائم"
placeholder="جستجوی علائم..."
value={symptomSearch}
onChange={(e) => setSymptomSearch(e.target.value)}
@@ -786,6 +787,7 @@ export default function ArchivePage({
<input
data-testid="shop-search-input"
type="text"
aria-label="جستجوی محصول"
placeholder="جستجوی محصول..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
@@ -815,6 +817,7 @@ export default function ArchivePage({
<input
data-testid="shop-search-input-mobile"
type="text"
aria-label="جستجوی محصول"
placeholder="جستجوی محصول..."
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
@@ -1003,6 +1006,7 @@ export default function ArchivePage({
<Search className="absolute right-3.5 top-1/2 -translate-y-1/2 w-4 h-4 text-medical-gray-400" />
<input
type="text"
aria-label="جستجوی علائم"
placeholder="جستجوی علائم بیماری یا نیاز دارویی..."
value={symptomSearch}
onChange={(e) => setSymptomSearch(e.target.value)}
@@ -151,6 +151,13 @@ describe("ArchivePage Component", () => {
expect(productService.getProducts).not.toHaveBeenCalled();
});
it("gives catalog search controls accessible names", () => {
render(<ArchivePage initialProducts={mockProducts as any} />);
expect(screen.getAllByLabelText("جستجوی محصول").length).toBe(2);
expect(screen.getAllByLabelText("جستجوی علائم").length).toBeGreaterThan(0);
});
beforeEach(() => {
vi.clearAllMocks();