Add browser test suite
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 45/100
- Loại issue
- Tính năng
- Độ rõ ràng
- Khá rõ ràng
- Mức độ hoạt động
- Sôi nổi
- Công nghệ
- github-actions, react, typescript
- Lĩnh vực
- testing-qa
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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.
- Ngôn ngữ chính
- TypeScript
- Star
- 620
- Fork
- 16
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của FormidableLabs/use-editable
-
Add oxlint lintingĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 52/100
-
cmd + / Keyboard ShortcutĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
FormidableLabs/use-editable#36 · 1 bình luận · 1 reaction ·
-
Identifier "b" has already been declaredCó thể đã có người làm @haneetsingh đã nhận 635 ngày trước. Đang mởbug
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Defocus every first typingĐang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 45/100
FormidableLabs/use-editable#30 · 3 bình luận · 1 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 42/100
Tất cả issue của FormidableLabs/use-editable
Issue tương tự
-
frontend
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 86/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
ranxianglei/billion-context#4172 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
awslabs/threat-composer#362 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Area/Cloud Needs Triage Type/Bug
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 86/100
wso2/product-integrator#2847 ·
Maintainer thường phản hồi trong vòng 1 ngày