test: assert matrix event summaries · openclaw/openclaw@5a77d79
shakkernerd
·
2026-05-11
·
via Recent Commits to openclaw:main
| Original file line number | Diff line number | Diff line change |
|---|
@@ -14,15 +14,18 @@ describe("summarizeMatrixRawEvent", () => {
|
14 | 14 | }, |
15 | 15 | }); |
16 | 16 | |
17 | | -expect(summary).toMatchObject({ |
| 17 | +expect(summary).toEqual({ |
18 | 18 | eventId: "$image", |
| 19 | +sender: "@gum:matrix.example.org", |
| 20 | +body: undefined, |
19 | 21 | msgtype: "m.image", |
20 | 22 | attachment: { |
21 | 23 | kind: "image", |
22 | 24 | filename: "photo.jpg", |
23 | 25 | }, |
| 26 | +timestamp: 123, |
| 27 | +relatesTo: undefined, |
24 | 28 | }); |
25 | | -expect(summary.body).toBeUndefined(); |
26 | 29 | }); |
27 | 30 | |
28 | 31 | it("preserves captions while marking media summaries", () => { |
@@ -38,13 +41,18 @@ describe("summarizeMatrixRawEvent", () => {
|
38 | 41 | }, |
39 | 42 | }); |
40 | 43 | |
41 | | -expect(summary).toMatchObject({ |
| 44 | +expect(summary).toEqual({ |
| 45 | +eventId: "$image", |
| 46 | +sender: "@gum:matrix.example.org", |
42 | 47 | body: "can you see this?", |
| 48 | +msgtype: "m.image", |
43 | 49 | attachment: { |
44 | 50 | kind: "image", |
45 | 51 | caption: "can you see this?", |
46 | 52 | filename: "photo.jpg", |
47 | 53 | }, |
| 54 | +timestamp: 123, |
| 55 | +relatesTo: undefined, |
48 | 56 | }); |
49 | 57 | }); |
50 | 58 | |
@@ -60,12 +68,17 @@ describe("summarizeMatrixRawEvent", () => {
|
60 | 68 | }, |
61 | 69 | }); |
62 | 70 | |
63 | | -expect(summary).toMatchObject({ |
| 71 | +expect(summary).toEqual({ |
| 72 | +eventId: "$image", |
| 73 | +sender: "@gum:matrix.example.org", |
64 | 74 | body: "see image.png", |
| 75 | +msgtype: "m.image", |
65 | 76 | attachment: { |
66 | 77 | kind: "image", |
67 | 78 | caption: "see image.png", |
68 | 79 | }, |
| 80 | +timestamp: 123, |
| 81 | +relatesTo: undefined, |
69 | 82 | }); |
70 | 83 | }); |
71 | 84 | |
|
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。