Skip to content

armgit / mso

Public Imported from GitHub
0

Browser-based graphical shell and control plane for a Linux server you own — real terminal, file manager, live metrics and BYOK AI in one mobile-first workspace. Next.js 16 · React 19 · node-pty · Tailwind v4 · shadcn/ui. Public alpha, self-hosted.

792 B
Raw Blame
import { describe, expect, it } from "vitest";
import { parseChannelPatch, validateTarget } from "./schema";

describe("channel schema", () => {
  const base = {
    name: "Support",
    provider: "telegram",
    credential: { user: "owner", connection: "bot" },
    enabled: true,
  };

  it("keeps channel records metadata-only", () => {
    expect(() => parseChannelPatch({ ...base, botToken: "123456:abcdefghijklmnopqrstuvwxyz" })).toThrow("secret_input_forbidden");
  });

  it("validates provider-specific targets", () => {
    expect(validateTarget("telegram", "-100123456789")).toBe("-100123456789");
    expect(validateTarget("discord", "123456789012345")).toBe("123456789012345");
    expect(() => validateTarget("discord", "#general")).toThrow("invalid_discord_target");
  });
});