web-ui tests: enable Testing Library cleanup for every test file
维护者通常 1 天内回复
还没有人认领这个 Issue。
评估
- 难度
- 4/5
- 预计耗时
- 3-5 天
- 新手友好度
- 50/100
- Issue 类型
- 缺陷
- 描述清晰度
- 基本清楚
- 活跃度
- 活跃
- 技术栈
- react, typescript
- 领域
- testing
调研方向
Start by reading web-ui/vitest.config.ts and web-ui/src/test/setup.ts, then inspect how test files currently call cleanup(). Decide whether to register cleanup in setup or enable globals, and check for tests that rely on state surviving between tests. Done means rendered components are cleaned up after each test, redundant per-file cleanup is removed where safe, and the test suite passes.
由索引模型根据 Issue 内容生成。
描述
Background
web-ui/vitest.config.ts does not enable globals, so afterEach is not global and @testing-library/react never registers its automatic cleanup. Components and hooks rendered in a test stay mounted until the file ends unless the file calls cleanup() itself.
#615 fixed one consequence: useStyleWorkspace.test.ts left three hooks mounted, and a hashchange in the last afterEach re-rendered them after jsdom was torn down. CI then reported ReferenceError: window is not defined and exited 1 although every test passed (seen on #609, #610 and main at c44d3479). Many other files already call cleanup() by hand; any file that does not has the same gap.
Proposal
Add afterEach(cleanup) to web-ui/src/test/setup.ts (or enable globals: true), then drop the per-file cleanup() calls that become redundant.
Open points
setup.tshook vs.globals: true(the latter also changes howdescribe/it/expectresolve).- Tests that rely on state surviving across tests in the same file will need checking.
- 主要语言
- Python
- 星标
- 136
- 派生
- 13
- 平均合并
- 7 小时 43 分钟
- 30 天内合并 PR
- 180
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
aws-samples/sample-spec-driven-presentation-maker 的其他 Issue
-
bug good first issue
难度 2/5 1-3 小时 新手友好度 86/100
aws-samples/sample-spec-driven-presentation-maker#648 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
aws-samples/sample-spec-driven-presentation-maker#646 ·
维护者通常 1 天内回复
-
Charts: setting `valueAxis` skips theme styling of axis labels and axis lines可能已有人在做 @ShotaroKataoka 于 1 天前认领。 未关闭bug
难度 3/5 1-2 天 新手友好度 67/100
aws-samples/sample-spec-driven-presentation-maker#630 ·
维护者通常 1 天内回复
-
enhancement good first issue
难度 4/5 3-5 天 新手友好度 68/100
aws-samples/sample-spec-driven-presentation-maker#622 ·
维护者通常 1 天内回复
-
Charts: add radar charts (chartType "radar")可能已有人在做 @tridev-tej 于 4 天前认领。 未关闭enhancement good first issue
难度 4/5 3-5 天 新手友好度 25/100
aws-samples/sample-spec-driven-presentation-maker#621 ·
维护者通常 1 天内回复
查看 aws-samples/sample-spec-driven-presentation-maker 的全部 Issue
相似的 Issue
-
firestore: enable live window.yaml pipeline system tests once add_window_fields is in production未关闭
难度 1/5 1 小时以内 新手友好度 64/100
googleapis/google-cloud-python#19115 ·
维护者通常 2 天内回复
-
enhancement
难度 2/5 1-3 小时 新手友好度 62/100
维护者通常 1 天内回复
-
难度 1/5 1 小时以内 新手友好度 75/100
-
难度 2/5 1-3 小时 新手友好度 78/100
维护者通常 1 天内回复
-
bug prov-json
难度 2/5 1-3 小时 新手友好度 87/100
维护者通常 1 天内回复