Skip to content

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

Sidebar test: Simple mode has the hover list where the thread tree's disclosure was

luishron123c806dfe9f206
diff --git a/src/components/Sidebar.advanced-back.test.ts b/src/components/Sidebar.advanced-back.test.ts
index ff553fa871..10e9516aab 100644
--- a/src/components/Sidebar.advanced-back.test.ts
+++ b/src/components/Sidebar.advanced-back.test.ts
@@ -44,7 +44,9 @@ async function draw() {
flushSync(() => root.render(createElement(BotEditorStore, { value, children: createElement(Sidebar, { open: true, onClose: () => {} }) })));
await settle();
}
-const expand = () => document.querySelector<HTMLButtonElement>(`button[aria-label="${t("task.expandNamed", { name: "Atlas" })}"]`);
+// Simple mode's hover list carries the same name as the tree's disclosure, so the tree's is the one that is not the list's.
+const expand = () => document.querySelector<HTMLButtonElement>(`button[aria-label="${t("task.expandNamed", { name: "Atlas" })}"]:not([data-bot-threads-peek])`);
+const peek = () => document.querySelector('[data-bot-threads-peek="atlas"]');
const folder = () => document.querySelector('[data-sidebar-folder-row="taxes"]');
beforeAll(() => {
@@ -76,8 +78,10 @@ describe("thread folders after Advanced mode comes back", () => {
await draw();
expect(folder()).toBeNull();
expect(expand()).toBeNull();
+ expect(peek(), "the hover list stands in for the tree").not.toBeNull();
flushSync(() => setAdvancedMode(true));
await draw();
+ expect(peek()).toBeNull();
expect(folder()?.textContent).toContain("Taxes");
});
});