Forked from OpenCode v1.17.4 with multi-agent system: - 5 agents: aircoding, scheduler, worker, architect, reviewer - Deterministic DAG scheduling engine (coordinator_tick) - Tool whitelists as hard enforcement - AirCoding validation plugin - System prompt injection for routing - V1 requirements: C4 docs, ADR, AGENTS.md, debug-log.md - Design documents in docs/
31 lines
1.1 KiB
TypeScript
31 lines
1.1 KiB
TypeScript
import { describe, expect, test } from "bun:test"
|
|
import stripAnsi from "strip-ansi"
|
|
|
|
import { defaultConsoleUrl, formatAccountLabel, formatOrgLine } from "../../src/cli/cmd/account"
|
|
|
|
describe("console account display", () => {
|
|
test("uses console.opencode.ai as the default login URL", () => {
|
|
expect(defaultConsoleUrl).toBe("https://console.opencode.ai")
|
|
})
|
|
|
|
test("includes the account url in account labels", () => {
|
|
expect(stripAnsi(formatAccountLabel({ email: "one@example.com", url: "https://one.example.com" }, false))).toBe(
|
|
"one@example.com https://one.example.com",
|
|
)
|
|
})
|
|
|
|
test("includes the active marker in account labels", () => {
|
|
expect(stripAnsi(formatAccountLabel({ email: "one@example.com", url: "https://one.example.com" }, true))).toBe(
|
|
"one@example.com https://one.example.com (active)",
|
|
)
|
|
})
|
|
|
|
test("includes the account url in org rows", () => {
|
|
expect(
|
|
stripAnsi(
|
|
formatOrgLine({ email: "one@example.com", url: "https://one.example.com" }, { id: "org-1", name: "One" }, true),
|
|
),
|
|
).toBe(" ● One one@example.com https://one.example.com org-1")
|
|
})
|
|
})
|