

























@@ -52,17 +52,16 @@ describe("qa-bus state", () => {
52525353const snapshot = state.getSnapshot();
5454expect(snapshot.threads).toHaveLength(1);
55-expect(snapshot.threads[0]).toMatchObject({
56-id: thread.id,
57-conversationId: "qa-room",
58-title: "QA thread",
59-});
60-expect(snapshot.messages[0]).toMatchObject({
61-id: message.id,
62-text: "inside thread (edited)",
63-deleted: true,
64-reactions: [{ emoji: "eyes", senderId: "alice" }],
65-});
55+expect(snapshot.threads[0]?.id).toBe(thread.id);
56+expect(snapshot.threads[0]?.conversationId).toBe("qa-room");
57+expect(snapshot.threads[0]?.title).toBe("QA thread");
58+expect(snapshot.messages[0]?.id).toBe(message.id);
59+expect(snapshot.messages[0]?.text).toBe("inside thread (edited)");
60+expect(snapshot.messages[0]?.deleted).toBe(true);
61+expect(snapshot.messages[0]?.reactions).toHaveLength(1);
62+expect(snapshot.messages[0]?.reactions[0]?.emoji).toBe("eyes");
63+expect(snapshot.messages[0]?.reactions[0]?.senderId).toBe("alice");
64+expect(snapshot.messages[0]?.reactions[0]?.timestamp).toEqual(expect.any(Number));
6665});
67666867it("waits for a text match and rejects on timeout", async () => {
@@ -156,11 +155,10 @@ describe("qa-bus state", () => {
156155157156const readback = state.readMessage({ messageId: outbound.id });
158157expect(readback.attachments).toHaveLength(1);
159-expect(readback.attachments?.[0]).toMatchObject({
160-kind: "image",
161-fileName: "qa-screenshot.png",
162-altText: "QA dashboard screenshot",
163-});
158+const attachment = readback.attachments?.[0];
159+expect(attachment?.kind).toBe("image");
160+expect(attachment?.fileName).toBe("qa-screenshot.png");
161+expect(attachment?.altText).toBe("QA dashboard screenshot");
164162165163const byFilename = state.searchMessages({
166164query: "screenshot",
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。