fix: 识别 MDTODO 任务树事实栏
This commit is contained in:
@@ -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);
|
||||
});
|
||||
Reference in New Issue
Block a user