Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion apps/web/e2e/input-labels.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,17 @@ import { expect, test } from '@playwright/test';
// A placeholder is not a label: it disappears as soon as the user types.
// Every visible field must be named by a <label>, aria-label or
// aria-labelledby (WCAG 1.3.1, 3.3.2; DOS/Rate#1077).
const PAGES = ['/smartphones', '/deals', '/merchants', '/leaderboard'];
const PAGES = [
'/smartphones',
'/deals',
'/merchants',
'/leaderboard',
// The pre-filled link input was named only by its placeholder
// (DOS/Rate#1088).
'/inspect',
'/contact-us',
'/compare',
];

for (const path of PAGES) {
test(`visible fields have a label on ${path}`, async ({ page }) => {
Expand Down
1 change: 1 addition & 0 deletions apps/web/locales/cs.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@
"title": "Kontrola odkazů z tržišť a detekce uměle navýšených cen",
"subtitle": "Vložte odkaz ze Shopee, Lazada, Tiki či TikTok Shop nebo název zařízení a porovnejte ho se skutečnou historií cen, rizikovými skóre prodejce a podílem falešných recenzí.",
"inputPlaceholder": "Vložte URL produktu/obchodu (např. https://shopee.vn/...-i.88201679.27110898667) nebo název modelu...",
"inputAria": "Odkaz na produkt nebo obchod, nebo název modelu",
"inspectBtn": "Zkontrolovat",
"inspectingBtn": "Kontroluji...",
"copyLinkBtn": "Kopírovat odkaz na report",
Expand Down
1 change: 1 addition & 0 deletions apps/web/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@
"title": "Check a product link and spot inflated list prices",
"subtitle": "Paste a Shopee, Lazada, Tiki or TikTok Shop link, or a device name, to compare it with real price history and see the seller's risk scores and fake-review share.",
"inputPlaceholder": "Paste product/shop URL (e.g. https://shopee.vn/...-i.88201679.27110898667) or model name...",
"inputAria": "Product or shop link, or model name",
"inspectBtn": "Check now",
"inspectingBtn": "Checking...",
"copyLinkBtn": "Copy result link",
Expand Down
1 change: 1 addition & 0 deletions apps/web/locales/vi.json
Original file line number Diff line number Diff line change
Expand Up @@ -733,6 +733,7 @@
"title": "Kiểm tra link sản phẩm và phát hiện giá gốc bị nâng khống",
"subtitle": "Dán link Shopee, Lazada, Tiki, TikTok Shop hoặc tên thiết bị để so với lịch sử giá thật, xem điểm rủi ro của gian hàng và tỷ lệ đánh giá ảo.",
"inputPlaceholder": "Dán URL sản phẩm/gian hàng (vd: https://shopee.vn/...-i.88201679.27110898667) hoặc nhập tên máy...",
"inputAria": "Link sản phẩm, gian hàng hoặc tên máy",
"inspectBtn": "Kiểm tra ngay",
"inspectingBtn": "Đang kiểm tra...",
"copyLinkBtn": "Sao chép link kết quả",
Expand Down
3 changes: 3 additions & 0 deletions apps/web/src/components/inspect/DeepInspectWorkspace.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -462,6 +462,9 @@ export default function DeepInspectWorkspace({
type="text"
className="form-control text-dark border-0"
placeholder={t('inputPlaceholder')}
// The sample URL pre-fills it, so the placeholder is never a
// visible label (DOS/Rate#1088).
aria-label={t('inputAria')}
value={queryInput}
onChange={(e) => setQueryInput(e.target.value)}
/>
Expand Down
Loading