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.

1.1 KB
Raw Blame
import { readFileSync } from "node:fs";
import { expect, it } from "vitest";
it("keeps power truth and offers retry instead of an endless failed spinner", () => {
  const source = readFileSync(new URL("./app.tsx", import.meta.url), "utf8");
  expect(source).toContain("await verifyViewerTransport(signal)");
  expect(source).not.toContain("...current, running: false");
  expect(source).toContain("Retry connection");
  expect(source).toContain(") : !error ? (");
});

it("retries only the read-only connection path and observes real polled power state", () => {
  const source = readFileSync(new URL("./app.tsx", import.meta.url), "utf8");
  const retry = source.split("const retryConnection = useCallback")[1]?.split("const power = useCallback")[0];
  expect(retry).toContain("await connect(controller.signal)");
  expect(retry).not.toContain("setPower(");
  expect(source).toContain("onClick={() => void retryConnection()}>Retry connection");
  expect(source).toContain("waitForViewer(signal, 30_000,");
  expect(source).toContain("if (!signal.aborted) setStatus(next)");
});