fix(web-probe): 接受移动端已选 MDTODO 详情

This commit is contained in:
Codex
2026-07-13 14:54:05 +02:00
parent 908a88b379
commit 62acb55a07
2 changed files with 43 additions and 3 deletions
@@ -6,6 +6,7 @@ import {
nodeWebObserveRunnerSamplingSource,
} from "./hwlab-node-web-observe-runner-sampling-source";
import { nodeWebObserveAnalyzerProjectSource } from "./hwlab-node-web-observe-analyzer-project-source";
import { nodeWebObserveRunnerControlSource } from "./hwlab-node-web-observe-runner-control-source";
test("MDTODO task tree pane gap treats the pinned facts footer as content", async () => {
assert.match(
@@ -93,3 +94,40 @@ test("MDTODO pane gap ignores a naturally short task tree but keeps primary pane
1,
);
});
test("MDTODO command readiness accepts a selected mobile task when the hidden tree has no visible rows", async () => {
const source = nodeWebObserveRunnerControlSource();
const makeReady = (snapshot: Record<string, unknown>) => new Function(
"projectManagementCommandSnapshot",
"safeUrlPath",
"currentPageUrl",
"page",
`${source}; return waitForProjectManagementCommandReady;`,
)(
async () => snapshot,
() => String(snapshot.path ?? ""),
() => `https://hwlab.pikapython.com${String(snapshot.path ?? "")}`,
{ waitForTimeout: async () => undefined },
) as (options: { timeoutMs: number }) => Promise<{ ok: boolean; reason: string }>;
const selectedMobileTask = {
path: "/projects/mdtodo/sources/source/files/file/tasks/R1",
pageKind: "project-management-mdtodo",
sourceCount: 3,
fileCount: 18,
taskCount: 0,
selectedTaskRef: { hash: "sha256:opaque" },
taskBodyVisible: true,
launchButtonVisible: true,
};
assert.equal((await makeReady(selectedMobileTask)({ timeoutMs: 1 })).ok, true);
const unselectedRoot = {
path: "/projects/mdtodo",
pageKind: "project-management-mdtodo",
sourceCount: 3,
fileCount: 18,
taskCount: 0,
};
assert.equal((await makeReady(unselectedRoot)({ timeoutMs: 1 })).ok, false);
});