fix(web-probe): 接受移动端已选 MDTODO 详情
This commit is contained in:
@@ -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);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user