Skip to content

Open-source Grok Bot alternative with a virtual machine that bots can use

test: keep the card text typed as a string in the reaction test

AdityaUmale1599dfeea49f
diff --git a/server/replies.test.ts b/server/replies.test.ts
index c940b510b1..7f08a68eb3 100644
--- a/server/replies.test.ts
+++ b/server/replies.test.ts
@@ -37,9 +37,10 @@ describe("the app's own add-a-key suggestion", () => {
});
it("keeps the person's reaction, and stays a card the bot did not write when it is a widget", () => {
- const card = message({ kind: "widget", text: "Want me to sort your email for free? Add a key.", setupSuggestion: { kind: "helperKey" } });
+ const text = "Want me to sort your email for free? Add a key.";
+ const card = message({ kind: "widget", text, setupSuggestion: { kind: "helperKey" } });
const reacted = message({ id: "m2", role: "user", text: "πŸ‘", replyToId: "m1", reaction: "πŸ‘" });
- expect(transcriptText(reacted, new Map([["m1", card]]))).toBe(`[reacted πŸ‘ to a card shown in this chat]\n${cardRecords(card.text)}`);
+ expect(transcriptText(reacted, new Map([["m1", card]]))).toBe(`[reacted πŸ‘ to a card shown in this chat]\n${cardRecords(text)}`);
const typed = promptWithReply("what is this?", card);
expect(typed).toContain("a card shown to the person in this chat, which you did not write");
expect(typed).not.toContain("a widget you showed");