mirror of
https://github.com/openclaw/openclaw.git
synced 2026-05-09 10:00:44 +00:00
test: assert matrix sas notice messages
This commit is contained in:
@@ -593,8 +593,10 @@ describe("registerMatrixMonitorEvents verification routing", () => {
|
||||
|
||||
await flushTasks();
|
||||
const bodies = getSentNoticeBodies(sendMessage);
|
||||
expect(bodies.some((body) => body.includes("SAS emoji:"))).toBe(true);
|
||||
expect(bodies.some((body) => body.includes("SAS decimal: 6158 1986 3513"))).toBe(true);
|
||||
expect(bodies).toEqual(expect.arrayContaining([expect.stringContaining("SAS emoji:")]));
|
||||
expect(bodies).toEqual(
|
||||
expect.arrayContaining([expect.stringContaining("SAS decimal: 6158 1986 3513")]),
|
||||
);
|
||||
});
|
||||
|
||||
it("rehydrates an in-progress DM verification before resolving SAS notices", async () => {
|
||||
@@ -961,7 +963,7 @@ describe("registerMatrixMonitorEvents verification routing", () => {
|
||||
|
||||
await vi.waitFor(() => {
|
||||
const bodies = getSentNoticeBodies(sendMessage);
|
||||
expect(bodies.some((body) => body.includes("SAS emoji:"))).toBe(true);
|
||||
expect(bodies).toEqual(expect.arrayContaining([expect.stringContaining("SAS emoji:")]));
|
||||
});
|
||||
} finally {
|
||||
vi.useRealTimers();
|
||||
@@ -1215,11 +1217,13 @@ describe("registerMatrixMonitorEvents verification routing", () => {
|
||||
});
|
||||
|
||||
await flushTasks();
|
||||
expect(
|
||||
getSentNoticeBodies(sendMessage).some((body) => body.includes("SAS decimal: 6158 1986 3513")),
|
||||
).toBe(true);
|
||||
expect(getSentNoticeBodies(sendMessage)).toEqual(
|
||||
expect.arrayContaining([expect.stringContaining("SAS decimal: 6158 1986 3513")]),
|
||||
);
|
||||
const bodies = getSentNoticeBodies(sendMessage);
|
||||
expect(bodies.some((body) => body.includes("SAS decimal: 1111 2222 3333"))).toBe(false);
|
||||
expect(bodies).not.toEqual(
|
||||
expect.arrayContaining([expect.stringContaining("SAS decimal: 1111 2222 3333")]),
|
||||
);
|
||||
});
|
||||
|
||||
it("preserves strict-room SAS fallback when active DM inspection cannot resolve a room", async () => {
|
||||
@@ -1321,11 +1325,13 @@ describe("registerMatrixMonitorEvents verification routing", () => {
|
||||
});
|
||||
|
||||
await flushTasks();
|
||||
expect(
|
||||
getSentNoticeBodies(sendMessage).some((body) => body.includes("SAS decimal: 6158 1986 3513")),
|
||||
).toBe(true);
|
||||
expect(getSentNoticeBodies(sendMessage)).toEqual(
|
||||
expect.arrayContaining([expect.stringContaining("SAS decimal: 6158 1986 3513")]),
|
||||
);
|
||||
const bodies = getSentNoticeBodies(sendMessage);
|
||||
expect(bodies.some((body) => body.includes("SAS decimal: 1111 2222 3333"))).toBe(false);
|
||||
expect(bodies).not.toEqual(
|
||||
expect.arrayContaining([expect.stringContaining("SAS decimal: 1111 2222 3333")]),
|
||||
);
|
||||
});
|
||||
|
||||
it("does not emit SAS notices for cancelled verification events", async () => {
|
||||
|
||||
Reference in New Issue
Block a user