test: clarify signal and matrix assertions · openclaw/openclaw@d7853ed
steipete
·
2026-05-08
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -140,8 +140,8 @@ describe("resolveMatrixTargets (users)", () => {
|
140 | 140 | kind: "group", |
141 | 141 | }); |
142 | 142 | |
143 | | -expect(userResults.every((entry) => entry.resolved)).toBe(true); |
144 | | -expect(groupResults.every((entry) => entry.resolved)).toBe(true); |
| 143 | +expect(userResults.filter((entry) => !entry.resolved)).toEqual([]); |
| 144 | +expect(groupResults.filter((entry) => !entry.resolved)).toEqual([]); |
145 | 145 | expect(listMatrixDirectoryPeersLive).toHaveBeenCalledTimes(1); |
146 | 146 | expect(listMatrixDirectoryGroupsLive).toHaveBeenCalledTimes(1); |
147 | 147 | }); |
|
| Original file line number | Diff line number | Diff line change |
|---|
@@ -108,6 +108,8 @@ describe("signal groups schema", () => {
|
108 | 108 | }, |
109 | 109 | }); |
110 | 110 | |
111 | | -expect(issues.some((issue) => issue.path.join(".").startsWith("groups"))).toBe(true); |
| 111 | +expect(issues.map((issue) => issue.path.join("."))).toContainEqual( |
| 112 | +expect.stringMatching(/^groups/), |
| 113 | +); |
112 | 114 | }); |
113 | 115 | }); |
| Original file line number | Diff line number | Diff line change |
|---|
@@ -85,7 +85,7 @@ describe("splitSignalFormattedText", () => {
|
85 | 85 | // First chunk should contain the bold style |
86 | 86 | const firstChunk = chunks[0]; |
87 | 87 | expect(firstChunk.text).toContain("bold"); |
88 | | -expect(firstChunk.styles.some((s) => s.style === "BOLD")).toBe(true); |
| 88 | +expect(firstChunk.styles.map((style) => style.style)).toContain("BOLD"); |
89 | 89 | // The bold style should start at position 0 in the first chunk |
90 | 90 | const boldStyle = requireStyle(firstChunk, "BOLD"); |
91 | 91 | expect(boldStyle.start).toBe(0); |
@@ -104,7 +104,7 @@ describe("splitSignalFormattedText", () => {
|
104 | 104 | if (!chunkWithBold) { |
105 | 105 | throw new Error("chunk containing bold text missing"); |
106 | 106 | } |
107 | | -expect(chunkWithBold.styles.some((s) => s.style === "BOLD")).toBe(true); |
| 107 | +expect(chunkWithBold.styles.map((style) => style.style)).toContain("BOLD"); |
108 | 108 | |
109 | 109 | // The bold style should have chunk-local offset (not original text offset) |
110 | 110 | const boldStyle = requireStyle(chunkWithBold, "BOLD"); |
@@ -211,7 +211,7 @@ describe("splitSignalFormattedText", () => {
|
211 | 211 | // Bold should be preserved in first chunk |
212 | 212 | const firstChunk = chunks[0]; |
213 | 213 | if (firstChunk.text.includes("bold")) { |
214 | | -expect(firstChunk.styles.some((s) => s.style === "BOLD")).toBe(true); |
| 214 | +expect(firstChunk.styles.map((style) => style.style)).toContain("BOLD"); |
215 | 215 | } |
216 | 216 | }); |
217 | 217 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。