Skip to content

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

Merge #7516: Composer: /archive and /delete act on the open conversation

milind-soni380b1c2035fd
diff --cc src/components/Composer.slash.test.ts
index d6fac1d193,5a5156ec21..d770251154
--- a/src/components/Composer.slash.test.ts
+++ b/src/components/Composer.slash.test.ts
@@@ -6,10 -6,11 +6,12 @@@ import { createRoot, type Root } from "
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { Bot } from "@/state/store";
import { restoreComposerDraft } from "@/lib/drafts";
+import { newChatThreadId } from "@/state/new-chat";
const dispatch = vi.hoisted(() => vi.fn());
+ const announceArchiveNotice = vi.hoisted(() => vi.fn());
const ENGINE = "claude-3f0c2b1e-9d1a-4c55-8a51-0a3a6f1e2b7c";
+ vi.mock("./bot-archive", () => ({ announceArchiveNotice }));
vi.mock("@/state/store", async (importOriginal) => {
const original = await importOriginal<typeof import("@/state/store")>();
return { ...original, useStore: () => ({
@@@ -68,6 -71,9 +72,9 @@@ describe("the / menu in the composer",
flushSync(() => input.dispatchEvent(new KeyboardEvent("keyup", { key: "/", bubbles: true })));
return input;
}
- function fill(text: string, caret = text.length) {
- return fillOn(draftId, text, caret);
++ function fill(text: string, caret = text.length, draft = draftId) {
++ return fillOn(draft, text, caret);
+ }
const options = () => [...document.body.querySelectorAll<HTMLElement>('[role="option"]')];
const labels = () => options().map((option) => option.querySelector(".truncate")?.textContent);
const press = (input: HTMLTextAreaElement, key: string) => flushSync(() => input.dispatchEvent(new KeyboardEvent("keydown", { key, bubbles: true })));