Hacktoberfest 2026:维护者为十月标记出来的 issue,仍然开放、适合新手。 浏览 Hacktoberfest issue

[BUG]: SettingsPage.test.jsx "Clear All" tests fail on main — confirmation step not handled

已关闭 适合新手
#283 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 3 天内回复

@RounakKumarAgarwal 已经在做这个了。

开始于 2026年10月1日。

  • #286 来自 @RounakKumarAgarwal —— 未关闭

评估

难度
1/5
预计耗时
1 小时以内
新手友好度
90/100
Issue 类型
缺陷
描述清晰度
描述清楚
活跃度
活跃
技术栈
javascript
领域
frontend, testing

调研方向

从 src/pages/SettingsPage.test.jsx 开始,运行 npx vitest run src/pages/SettingsPage.test.jsx 以复现两个失败。结合 SettingsPage.jsx 中描述的确认行为阅读 Clear All 测试,然后更新测试设置,使确认得到接受。当三个测试全部通过并到达 "cleared" 按钮断言时,即表示完成。

由索引模型根据 Issue 内容生成。

描述

bug
Bug Description

Two of the three tests in src/pages/SettingsPage.test.jsx fail on current main. The
"Clear All" tests wait for a button labeled "cleared" to appear after clicking "Clear all":

expect(await screen.findByRole('button', { name: /cleared/i })).toBeInTheDocument()

This times out. It looks like #267 (two-step confirmation for destructive actions)
changed the Clear All flow — there's now a confirmation step before the action completes —
but the test wasn't updated to click through the new confirmation, so it never reaches
the "cleared" state.

Steps to Reproduce
  1. On current main, run: npx vitest run src/pages/SettingsPage.test.jsx
  2. Observe 2 of 3 tests fail at the findByRole('button', { name: /cleared/i }) assertion.
Logs and Screenshots

FAIL src/pages/SettingsPage.test.jsx
❯ findByRole('button', { name: /cleared/i }) timed out
at src/pages/SettingsPage.test.jsx:59

Tests 2 failed | 1 passed (3)

Environment Details
  • Branch: main (with #267 merged)
  • Node.js: 22.17.0
  • Root cause: #267 added window.confirm('Clear all cached data?') at the start of
    handleClear in SettingsPage.jsx. The test (added in an earlier PR) clicks "Clear All"
    but doesn't handle the new confirm dialog, so handleClear returns early and never
    reaches the "Cleared" state. Fix: the test should mock window.confirm to return true.
Impact

Medium - Feature works but has issues

Code of Conduct
  • I have joined the Discord server and will post updates there
  • I have searched existing issues to avoid duplicates
主要语言
JavaScript
星标
45
派生
148
平均合并
5 天 15 小时
30 天内合并 PR
28

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

AOSSIE-Org/OrgExplorer 的其他 Issue

查看 AOSSIE-Org/OrgExplorer 的全部 Issue

相似的 Issue

更多 JavaScript Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。