Hacktoberfest 2026: los issues que los mantenedores marcaron para octubre, abiertos y aptos para principiantes. Explorar issues de Hacktoberfest

Add browser test suite

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

Nadie ha tomado este issue todavía.

Evaluación

Dificultad
4/5
Tiempo estimado
3-5 días
Aptitud para principiantes
45/100
Tipo de issue
Nueva funcionalidad
Claridad
Bastante claro
Estado de actividad
Activo
Stack tecnológico
github-actions, react, typescript
Área
testing-qa

Línea de trabajo

Start with the hook source and the contentEditable editing paths it drives, then copy the browser-test setup from react-live (vitest.browser.mts and its stories/ folder). Add the npm run test script, keep it out of npm run check, and add a CI job that installs Chromium and runs the suite on the React 18.0.0 leg. Done when the checklist items are covered, the caret regression test for #37 passes, and CONTRIBUTING.md explains how to run the suite.

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

Descripción

use-editable has no tests. Add a browser test suite, following react-live's setup (vitest + @vitest/browser-playwright, stories run in real Chromium).

jsdom can't stand in here: it has no contentEditable editing model, so typing, selection, and caret behavior have to be exercised in a real browser.

Coverage to aim for

  • Typing: characters land in the right place, and onChange receives the right text and Position
  • Caret position: preserved across re-renders, including an unrelated parent re-render mid-keystroke (regression test for #37)
  • Undo / redo: Cmd/Ctrl+Z and Shift+Cmd/Ctrl+Z history
  • Indentation: opts.indentation Tab/Shift+Tab and backspace behavior
  • Edit API: update, insert (including negative offsets), move (offset and { row, column }), getState
  • opts.disabled: toggling it on and off
  • Line breaks: Enter, <br> handling, trailing newline

Setup

  • vitest browser config + Playwright Chromium (see react-live's vitest.browser.mts and stories/)
  • npm run test script (kept out of npm run check, like react-live, so the main check stays fast)
  • CI job that installs Chromium and runs the suite, including the React 18.0.0 compat leg
  • Document in CONTRIBUTING.md

Related: #38 (oxlint). Its hooks-order fix would benefit from these tests landing first.

Lenguaje dominante
TypeScript
Estrellas
620
Forks
16
Métricas de merge de PR
Sin PR fusionados en 30 d

Preparar el entorno

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 FormidableLabs/use-editable

Todos los issues de FormidableLabs/use-editable

Issues similares

Más issues de TypeScript

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.