mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 02:00:43 +00:00
test: clarify signal and matrix assertions
This commit is contained in:
@@ -140,8 +140,8 @@ describe("resolveMatrixTargets (users)", () => {
|
||||
kind: "group",
|
||||
});
|
||||
|
||||
expect(userResults.every((entry) => entry.resolved)).toBe(true);
|
||||
expect(groupResults.every((entry) => entry.resolved)).toBe(true);
|
||||
expect(userResults.filter((entry) => !entry.resolved)).toEqual([]);
|
||||
expect(groupResults.filter((entry) => !entry.resolved)).toEqual([]);
|
||||
expect(listMatrixDirectoryPeersLive).toHaveBeenCalledTimes(1);
|
||||
expect(listMatrixDirectoryGroupsLive).toHaveBeenCalledTimes(1);
|
||||
});
|
||||
|
||||
@@ -108,6 +108,8 @@ describe("signal groups schema", () => {
|
||||
},
|
||||
});
|
||||
|
||||
expect(issues.some((issue) => issue.path.join(".").startsWith("groups"))).toBe(true);
|
||||
expect(issues.map((issue) => issue.path.join("."))).toContainEqual(
|
||||
expect.stringMatching(/^groups/),
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@@ -85,7 +85,7 @@ describe("splitSignalFormattedText", () => {
|
||||
// First chunk should contain the bold style
|
||||
const firstChunk = chunks[0];
|
||||
expect(firstChunk.text).toContain("bold");
|
||||
expect(firstChunk.styles.some((s) => s.style === "BOLD")).toBe(true);
|
||||
expect(firstChunk.styles.map((style) => style.style)).toContain("BOLD");
|
||||
// The bold style should start at position 0 in the first chunk
|
||||
const boldStyle = requireStyle(firstChunk, "BOLD");
|
||||
expect(boldStyle.start).toBe(0);
|
||||
@@ -104,7 +104,7 @@ describe("splitSignalFormattedText", () => {
|
||||
if (!chunkWithBold) {
|
||||
throw new Error("chunk containing bold text missing");
|
||||
}
|
||||
expect(chunkWithBold.styles.some((s) => s.style === "BOLD")).toBe(true);
|
||||
expect(chunkWithBold.styles.map((style) => style.style)).toContain("BOLD");
|
||||
|
||||
// The bold style should have chunk-local offset (not original text offset)
|
||||
const boldStyle = requireStyle(chunkWithBold, "BOLD");
|
||||
@@ -211,7 +211,7 @@ describe("splitSignalFormattedText", () => {
|
||||
// Bold should be preserved in first chunk
|
||||
const firstChunk = chunks[0];
|
||||
if (firstChunk.text.includes("bold")) {
|
||||
expect(firstChunk.styles.some((s) => s.style === "BOLD")).toBe(true);
|
||||
expect(firstChunk.styles.map((style) => style.style)).toContain("BOLD");
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user