test: prove the status filter filters; fix a regex escape in the filter builder

An operator reports that "QRZ.com received status = N" returns rows showing both
N and Y (issue #5 follow-up). The SQL is a plain col = ?, but reading it cannot
distinguish a wrong query from a UI that kept the previous rows after an error —
so this runs it: five QSOs inserted, filtered, and both the list and the count
asserted. The backend filters correctly, list and count agree. The fault is not
in the query.

Found while looking: the filter builder tested an ADIF date with /^d{8}$/ instead
of /^\d{8}$/. The escape was missing, so the branch never matched and the
calendar input was handed "20260728", which type=date rejects — an empty box
over a value that was really stored.
This commit is contained in:
2026-07-29 08:19:18 +02:00
parent 8a0d76fa0c
commit 3b296b19ab
3 changed files with 81 additions and 1 deletions
+5 -1
View File
@@ -278,7 +278,11 @@ export function FilterBuilder({ open, initial, onApply, onClose }: Props) {
className="h-8 flex-1 text-xs"
disabled={!needsValue}
placeholder={needsValue ? (fieldType === 'date' ? 'YYYY-MM-DD' : t('fltb.valuePh')) : '—'}
value={fieldType === 'adifdate' && /^d{8}$/.test(c.value)
// \d, not d: the escape was missing, so the test never matched
// an 8-digit ADIF date and the calendar input was handed
// "20260728" — which type=date rejects, showing an empty box
// over a value that was really there.
value={fieldType === 'adifdate' && /^\d{8}$/.test(c.value)
? `${c.value.slice(0, 4)}-${c.value.slice(4, 6)}-${c.value.slice(6, 8)}`
: c.value}
onChange={(e) => setCond(i, {