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.

858 B
Raw Blame
import { beforeEach, describe, expect, it } from "vitest";
import { listRecents } from "./recents";
import { closeAll, openWindow } from "./store";

describe("recent apps", () => {
  beforeEach(() => closeAll());

  it("records launches newest-first and dedupes per app", () => {
    openWindow("files", "Files");
    openWindow("docs", "Docs");
    openWindow("files", "Files"); // focus existing — no new window, no re-record
    const apps = listRecents().map((r) => r.app);
    expect(apps.slice(0, 2)).toEqual(["docs", "files"]);
    expect(apps.filter((a) => a === "files")).toHaveLength(1);
  });

  it("re-records after close + reopen, moving the app to the front", () => {
    openWindow("files", "Files");
    openWindow("docs", "Docs");
    closeAll();
    openWindow("files", "Files");
    expect(listRecents()[0].app).toBe("files");
  });
});