test(web): cover the re-select no-op branch in WorkspaceSwitcher onValueChange
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 2/5
- 预计耗时
- 1-3 小时
- 新手友好度
- 82/100
- Issue 类型
- 功能
- 描述清晰度
- 描述清楚
- 活跃度
- 冷清
- 技术栈
- react, typescript
- 领域
- testing
调研方向
守卫逻辑位于 apps/web/src/components/AppLayout.tsx:227,即工作区选择器的 onValueChange 中。需要扩展的测试是 apps/web/e2e/workspace-switcher.spec.ts 中第 51-61 行的 picking another workspace commits the selection。请先阅读该守卫,了解当重新选择的工作区与当前激活的工作区相同时的 no-op 分支。完成标准是:该测试同时重新选择当前激活的工作区,断言触发器文本保持不变,Loading workspace… 的出现次数为 0,并且测试套件通过。
由索引模型根据 Issue 内容生成。
描述
Follow-up from PR #1647 (review: https://github.com/kinged007/saas-template/pull/1647#pullrequestreview-2860562339, "Low — uncovered no-op branch").
Finding
apps/web/src/components/AppLayout.tsx:227 guards if (target && target.id !== workspace?.id). PR #1647 added two tests that traverse the true path (picking a different workspace), but never the false one. Re-picking the already-active workspace closes the picker and must not commit, must not navigate, and must not trip the switching cache-wipe gate (Loading workspace… full unmount of AppLayout). That is the one onValueChange path still dark after this PR, and the path where an accidental commit would be invisible today.
Suggested approach
Two extra assertions in the existing picking another workspace commits the selection test at apps/web/e2e/workspace-switcher.spec.ts:51-61:
await trigger.click();
await page.getByRole("option", { name: /Beta Corp/ }).click();
await expect(trigger).toContainText("Beta Corp");
await expect(page.getByText("Loading workspace…")).toHaveCount(0);
- 主要语言
- Python
- 星标
- 0
- 派生
- 0
- 平均合并
- 13 小时 28 分钟
- 30 天内合并 PR
- 44
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 没有贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
kinged007/saas-template 的其他 Issue
-
area:config P2 risk:low size:s track:lite type:chore
难度 2/5 1-3 小时 新手友好度 74/100
kinged007/saas-template#1827 ·
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 72/100
kinged007/saas-template#1783 ·
维护者通常 1 天内回复
-
enhancement
难度 1/5 1 小时以内 新手友好度 88/100
kinged007/saas-template#1768 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 82/100
kinged007/saas-template#1767 ·
维护者通常 1 天内回复
-
enhancement
难度 2/5 1 小时以内 新手友好度 70/100
kinged007/saas-template#1764 ·
维护者通常 1 天内回复
查看 kinged007/saas-template 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 62/100
OpenFreeEnergy/openfe#2371 ·
维护者通常 2 天内回复
-
HMDB's smiles file writes "None" for metabolites with an empty <smiles/> (file not currently used)未关闭
难度 2/5 1-3 小时 新手友好度 80/100
NCATSTranslator/Babel#1269 ·
维护者通常 1 天内回复
-
难度 2/5 半天 新手友好度 80/100
维护者通常 1 天内回复
-
bug
难度 2/5 1-3 小时 新手友好度 64/100
bcgov/nr-hydrometric-rating-curve#443 ·
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 88/100