| 1234567891011121314151617181920212223242526 |
- import { describe, expect, test } from "bun:test"
- import stripAnsi from "strip-ansi"
- import { formatAccountLabel, formatOrgLine } from "../../src/cli/cmd/account"
- describe("console account display", () => {
- test("includes the account url in account labels", () => {
- expect(stripAnsi(formatAccountLabel({ email: "[email protected]", url: "https://one.example.com" }, false))).toBe(
- "[email protected] https://one.example.com",
- )
- })
- test("includes the active marker in account labels", () => {
- expect(stripAnsi(formatAccountLabel({ email: "[email protected]", url: "https://one.example.com" }, true))).toBe(
- "[email protected] https://one.example.com (active)",
- )
- })
- test("includes the account url in org rows", () => {
- expect(
- stripAnsi(
- formatOrgLine({ email: "[email protected]", url: "https://one.example.com" }, { id: "org-1", name: "One" }, true),
- ),
- ).toBe(" ● One [email protected] https://one.example.com org-1")
- })
- })
|