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

Abierto
#41 0 comentarios 0 reacciones 0 asignados Ver en GitHub

Los mantenedores suelen responder en 1 día

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
55/100
Tipo de issue
Nueva funcionalidad
Claridad
Bien especificado
Estado de actividad
Activo
Stack tecnológico
eslint, react, typescript

Línea de trabajo

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.

Escrito por el modelo de indexación a partir del texto del issue.

Descripción

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.

Lenguaje dominante
Python
Estrellas
1
Forks
1
Merge medio
4 h 46 min
PR fusionados (30 d)
55

Preparar el entorno

Este proyecto no incluye contenedor de desarrollo, Dockerfile ni guía de contribución, así que la configuración corre por tu cuenta: empieza por su README y consulta nuestra guía para la primera contribución para los pasos generales.

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Más de falbany/ProFiles

Todos los issues de falbany/ProFiles

Issues similares

Más issues de Python

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.