fix: 识别 MDTODO 任务树事实栏

This commit is contained in:
Codex
2026-07-13 06:48:24 +02:00
parent 6f4cd1518a
commit e7961469ae
2 changed files with 38 additions and 1 deletions
@@ -0,0 +1,24 @@
import assert from "node:assert/strict";
import { test } from "bun:test";
import {
MDTODO_TASK_TREE_PANE_CONTENT_SELECTOR,
nodeWebObserveRunnerSamplingSource,
} from "./hwlab-node-web-observe-runner-sampling-source";
test("MDTODO task tree pane gap treats the pinned facts footer as content", async () => {
assert.match(MDTODO_TASK_TREE_PANE_CONTENT_SELECTOR, /\[data-testid="mdtodo-task-tree-facts"\]/u);
const source = nodeWebObserveRunnerSamplingSource();
assert.ok(source.includes(`measurePaneGap("task-tree", '[data-testid="mdtodo-task-tree"]', ${JSON.stringify(MDTODO_TASK_TREE_PANE_CONTENT_SELECTOR)})`));
const child = Bun.spawn(["node", "--input-type=module", "--check", "-"], {
stdin: "pipe",
stdout: "pipe",
stderr: "pipe",
});
child.stdin.write(source);
child.stdin.end();
const [stderr, exitCode] = await Promise.all([new Response(child.stderr).text(), child.exited]);
assert.equal(exitCode, 0, stderr);
});