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.

test(tui): wait for the footer before asserting on the pty grid

Abdurrahman Fakhrul4ff0b9d257f0
diff --git a/scripts/mso-agent-pty.e2e.test.ts b/scripts/mso-agent-pty.e2e.test.ts
index e5b422c0..391c2b85 100644
--- a/scripts/mso-agent-pty.e2e.test.ts
+++ b/scripts/mso-agent-pty.e2e.test.ts
@@ -125,9 +125,11 @@ describeSuite("mso agent in real PTY e2e", () => {
const { child, cleanup } = spawnAgentPty(serverUrl, 100, 30);
const term = createTerminal(100, 30);
try {
+ // Wait for the FOOTER, not just the prompt. The prompt glyph is painted before the status rows,
+ // so waiting on it returned a grid that was still half drawn and the assertions below raced it.
const output = await waitFor(child, (chunk, total) => {
term.write(chunk);
- return total.includes("❯") || total.includes("›");
+ return total.includes("^P commands") && (total.includes("❯") || total.includes("›"));
});
const lines = term.getLines();
expect(lines.filter((l) => l.includes("● @mso"))).toHaveLength(1);