Skip to content

Linger is An Open-Source Personal Agent That Runs Fully on Your PC. We aim to break Big Tech’s grip on AI by bringing powerful local AI to everyday computers through efficient model–harness co-design, so everyone can run their own.

1.1 KB
Raw Blame
import { describe, expect, it } from "vitest";
import {
  voiceModeStatusLabel,
  type VoiceModePresentation,
} from "./voice-mode-presentation";

describe("Voice Mode visible status", () => {
  it.each<[Partial<VoiceModePresentation>, string]>([
    [{ status: "connecting" }, "Connecting microphone…"],
    [{ status: "listening" }, "Listening · Sends when you finish speaking"],
    [
      { status: "listening", flushing: true },
      "Finishing this message… You can keep speaking",
    ],
    [
      { status: "listening", sending: true },
      "Sending message… You can keep speaking",
    ],
    [
      { status: "closing", sending: true },
      "Microphone off · Finishing last words…",
    ],
    [{ status: "error" }, "Voice input stopped · Exit to review your draft"],
    [
      { error: "Connection lost. Your draft is kept." },
      "Connection lost. Your draft is kept.",
    ],
    [{ entered: false, status: "paused" }, "Microphone off · Draft kept"],
  ])("describes real state %j", (state, label) => {
    expect(voiceModeStatusLabel({ entered: true, text: "", ...state })).toBe(
      label,
    );
  });
});