Files
mnote/.codex/reasonix-tasks/results/batch-b2-worker-e-mindmap-smoke-resource-tab.md
T

66 lines
2.8 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Batch B2 Worker E — Mindmap ResourceTab Smoke Update
## 修改文件
- `scripts/task443-filetree-mindmap-click-active-row-smoke.js`
- `scripts/task445-filetree-mindmap-switch-no-flicker-smoke.js`
## 修改内容
将两个 smoke 中检查旧路由 `/mindmap/${docId}/${mindmapId}``waitForURL` 全部替换为检查当前 ResourceTab URL 模式的 `waitForFunction`
### 具体替换逻辑
| 位置 | 原检查 | 新检查 |
|------|--------|--------|
| task443 第 1 次点击 | `waitForURL` 期望 pathname 含 `/mindmap/${docId}/${mindmapId}` | `waitForFunction` 检查 pathname 含 `/documents/${docId}` + `resourceTab` search param 包含 `resource:mindmap:${docId}:${mindmapId}` |
| task445 第 1 次点击(同一文档) | 同上 | 同上 |
| task445 第 3 次点击(跨文档) | 同上 | `waitForFunction` 检查 pathname 以 `/documents/` 开头 + `resourceTab` 包含 `resource:mindmap:${docId}:${mindmapId}``docId` 为 mindmap 所属文档,与当前 page doc 无关) |
task445 第 2 次点击(切换到 otherDoc)的 `waitForURL` 检查 `/documents/${otherDoc.documentId}` 无需修改。
## 验收运行结果
### task443 ✅ PASS
```
ok task443-filetree-mindmap-click-active-row-smoke .../result.json
```
- `ok: true`
- `afterUrl`: `/documents/${docId}?workspaceId=...&resourceTab=resource%3Amindmap%3A${docId}%3A${mindmapId}`
- `afterSelectedRows`: mindmap asset row 具有 `data-selected="true"`
- 无父页面 doc row 选中
### task445 ✅ PASS
```
ok task445-filetree-mindmap-switch-no-flicker-smoke .../result.json
```
- `ok: true`, `failures: []`
- Step 1 → mindmap: `mindmapSelected: "true"`, `pageSelected: "false"`, path `/documents/docA`
- Step 2 → otherDoc: `mindmapSelected: "false"`, `pageSelected: "true"`, path `/documents/docB`
- Step 3 → mindmap again: `mindmapSelected: "true"`, `pageSelected: "false"`, path 保持 `/documents/docB`URL 含 `resourceTab=resource:mindmap:${docA}:${mindmapId}`
- 三次 `fileRootStable` 均为 `true`sidebar root 未被替换)
## task445 400 情况说明
**仍有一次 400**。consoleMessages 捕获到:
```
Failed to load resource: the server responded with a status of 400 (Bad Request)
```
请求线索:第 3 步(跨文档点击 mindmap)时,URL 切换到 `/documents/docB?resourceTab=resource:mindmap:docA:mindmapId` 后,client 发起了对 doc A mindmap 的 API GET 请求,但当前上下文是 doc BMindmap API handler 拒绝了该请求。
这不是 smoke 假 — 是当前后端对跨文档 ResourceTab 打开方式的限制。当用户在 doc B 页面打开 doc A 的 mindmap 资源时,对应的 `/api/mindmap/${docA}/${mindmapId}` 请求返回 400。
## 未完成项
无。两个 smoke 均通过。
## 风险
无直接风险。smoke 修改只影响 URL 断言模式,不改变业务逻辑。