prompt-scope.test.ts 532 B

1234567891011121314
  1. import { expect, test } from "bun:test"
  2. import { ServerConnection } from "@/context/server"
  3. import { selectPromptTab } from "@/context/prompt"
  4. import type { Tab } from "@/context/tabs"
  5. test("selects the explicitly scoped session tab instead of the active tab", () => {
  6. const server = ServerConnection.Key.make("local")
  7. const tabs: Tab[] = [
  8. { type: "session", server, sessionId: "A" },
  9. { type: "session", server, sessionId: "B" },
  10. ]
  11. expect(selectPromptTab(tabs, { dir: "repo", id: "B" }, server)).toBe(tabs[1])
  12. })