Add browser test suite
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 45/100
- Tipo di issue
- Funzionalità
- Chiarezza
- Abbastanza chiara
- Stato di attività
- Attiva
- Stack tecnologico
- github-actions, react, typescript
- Ambito
- testing-qa
Direzione di ricerca
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.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
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
onChangereceives the right text andPosition - 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.indentationTab/Shift+Tab and backspace behavior -
EditAPI: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.mtsandstories/) -
npm run testscript (kept out ofnpm 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.
- Lingua principale
- TypeScript
- Stelle
- 620
- Fork
- 16
- Metriche di merge delle PR
- Nessuna PR unita negli ultimi 30g
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
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di FormidableLabs/use-editable
-
Add oxlint lintingAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
-
cmd + / Keyboard ShortcutAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
FormidableLabs/use-editable#36 · 1 commento · 1 reazione ·
-
Identifier "b" has already been declaredForse già presa @haneetsingh l’ha presa 634 giorni fa. Apertabug
Difficoltà 4/5 3-5 giorni Idoneità per principianti 25/100
-
Defocus every first typingAperta
Difficoltà 3/5 1-2 giorni Idoneità per principianti 45/100
FormidableLabs/use-editable#30 · 3 commenti · 1 reazione ·
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 42/100
Tutte le issue di FormidableLabs/use-editable
Issue simili
-
e2e-failure ready-to-code
Difficoltà 2/5 1-3 ore Idoneità per principianti 68/100
redhat-developer/rhdh-plugin-export-overlays#4460 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
I maintainer di solito rispondono entro 1 giorno
-
docs(api): openapi.yaml still documents gif-tools optimize colors as 2-256 instead of 2, 4, 16, 256Apertaarea: backend documentation priority: low
Difficoltà 2/5 1-3 ore Idoneità per principianti 84/100
snapotter-hq/SnapOtter#2919 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 77/100
obsidianmd/pele#39 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 76/100
biomejs/biome#12475 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno