Skip to content

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

Rail: a click's answer is typed; + for Add another account alone is tested

milind-soni455853a0667f
diff --git a/src/components/PlacesRail.test.ts b/src/components/PlacesRail.test.ts
index 5b7848f77e..8ba7762394 100644
--- a/src/components/PlacesRail.test.ts
+++ b/src/components/PlacesRail.test.ts
@@ -524,3 +524,12 @@ it("colours stay per Cloud, whichever account it belongs to", async () => {
const fill = (id: string) => (host.querySelector(`[data-rail-place="${id}"] [aria-hidden="true"][style]`) as HTMLElement | null)?.getAttribute("style");
expect(fill("a1")).not.toEqual(fill("b1"));
});
+
+it("+ stands for Add another account alone, when nothing else can be added", async () => {
+ rail = { places: TWO_ACCOUNTS, add: { cloud: false, link: false, address: false, account: true } };
+ await mount(createElement(PlacesRail));
+ expect(host.querySelector("[data-rail-add]")).not.toBeNull();
+ rail = { places: TWO_ACCOUNTS, add: { cloud: false, link: false, address: false } };
+ await act(async () => { await refreshPlaces(); });
+ expect(host.querySelector("[data-rail-add]")).toBeNull();
+});
diff --git a/src/types/ogb.d.ts b/src/types/ogb.d.ts
index df2fd31d88..aa956f0cea 100644
--- a/src/types/ogb.d.ts
+++ b/src/types/ogb.d.ts
@@ -171,7 +171,8 @@ const __APP_VERSION__: string;
* places). Absent on an older app. */
places?: () => Promise<import("../../electron/cloud-rail.mjs").RailState>;
/** Opens a circle main listed, by its id, through main's own switch: only from the person's click. */
- open?: (id: string) => Promise<unknown>;
+ /** Nothing for a place of the account in use; for another account's, how its switch went. */
+ open?: (id: string) => Promise<import("../../electron/cloud-account.mjs").RailOpenResult | undefined>;
/** +'s fixed choices: buy a Cloud (this computer's own sheet), a server's pairing link (`link`: the one pasted on the
* sheet; without it, the clipboard's), or type its address. Resolves false when the person cancels Connect. */
add?: (choice: "cloud" | "link" | "address", link?: string) => Promise<unknown>;