Skip to content

Commit 45ce929

Browse files
committed
test(refine): pin right pane before negative assert
1 parent 854c0af commit 45ce929

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

‎app/src/components/RefineWorkbench.test.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,9 @@ describe("RefineWorkbench 行级染色与差异视图(批 3 / 问题11)", ()
155155
expect(badgeHeading).not.toBeNull();
156156
expect(badgeHeading?.textContent).toBe("标题修改");
157157
expect(badgeHeading?.querySelectorAll("span").length).toBe(1);
158-
// Assert:栏内无闭合标签残片(错位插入会把 `</h2>` 拆成游离文本 `<` + `/h2>`)
158+
// Assert:栏内无闭合标签残片(错位插入会把 `</h2>` 拆成游离文本 `<` + `/h2>`)。
159+
// 先钉住栏非空,否则两条 `not.toContain` 在「栏取到空元素」时空真。
160+
expect(rightPane.textContent).toContain("标题修改");
159161
expect(rightPane.textContent).not.toContain("<");
160162
expect(rightPane.textContent).not.toContain("/h");
161163
});

0 commit comments

Comments
 (0)