[Docs] Testing Recipes: broken test code
未關閉
適合新手
還沒有人認領這個 Issue。
- 主要語言
- JavaScript
- 星號
- 11.8k
- 分支
- 7.9k
- 平均合併
- 1 天 11 小時
- 30 天內合併 PR
- 11
描述
Hi, I think there's a little bug in the example code in the Testing Recipes section.
https://reactjs.org/docs/testing-recipes.html#events
When I copy the code for toggle.js and toggle.test.js into a fresh sample project and run npm run test, I get a failed test.
It looks like the expectations are backwards vs. the initial state in the toggle component.
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
從連結的文件 URL 中 Testing Recipes 的「Events」區段開始,並檢查 toggle.js 和 toggle.test.js 範例。將它們複製到全新的範例專案中並執行 npm run test,以重現此失敗。文件中的範例通過測試,且其預期結果與 toggle 元件的初始狀態一致,即表示完成。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- javascript, react
- 領域
- documentation
- Issue 類型
- 文件
- 難度
- 1/5
- 預估耗時
- 1-3 小時
- 活躍度
- 停滯
- 描述清晰度
- 描述清楚
- 新手友好度
- 62/100