Web: add ESLint and component test infrastructure (jsdom + testing-library); cover barcodeScanner and exportCsv

Aperta
#41 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
55/100
Tipo di issue
Funzionalità
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
eslint, react, typescript

Direzione di ricerca

Start by reading web/vitest.config.ts and package.json to see current test setup. Add ESLint config and lint script, then run it to fix hook-dependency warnings in FileListTable.tsx and LoadConfigModal.tsx. Next, configure jsdom and @testing-library/react, writing a modal and an App keyboard test as patterns. Finally, add tests for utils/barcodeScanner.ts and utils/exportCsv.ts, and document npm test in web/README.md; done when lint and all tests pass.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

code-quality enhancement frontend

The web app has vitest but effectively no safety net:

  • No ESLint — no config and no lint script anywhere in web/. That's why hook-dependency bugs (dep-less effect at FileListTable.tsx:370-377; missing browse dep at LoadConfigModal.tsx:55) were never flagged. Add eslint + typescript-eslint + eslint-plugin-react-hooks with a lint script, and wire it into pre-commit alongside ruff.
  • No component tests — vitest.config.ts runs in the default node env; no jsdom, no @testing-library/react in devDependencies. All 23 components and the 1572-line App.tsx (scan races, global keyboard handler, barcode flow, drag state) are untested. Existing tests cover only pure modules (client, configDrop, fileProperties, searchSyntax, theme, barcodeDecoder).
  • Untested pure logic that's trivially testable: utils/barcodeScanner.ts (parseBarcodeInput — the whole barcode key=value language incl. alias normalization and boolean parsing) and utils/exportCsv.ts (RFC 4180 quoting).
  • Document npm test in web/README.md (it documents build/dev only).

Suggested order: ESLint + fix its findings → jsdom/testing-library with one modal + one App keyboard test as the pattern → the two pure-logic test files.

Lingua principale
Python
Stelle
1
Fork
1
Merge medio
4h 46m
PR unite (30g)
55

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di falbany/ProFiles

Tutte le issue di falbany/ProFiles

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.