From 70019c0ed7452aefb7ae3bc1b4a67941982ec09c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:29:49 +0000 Subject: [PATCH 1/2] Initial plan From 15f3f0741413ee8848960a47e868549b34490192 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 26 Mar 2026 12:37:40 +0000 Subject: [PATCH 2/2] fix: box setup welcome prompt Co-authored-by: ChangeHow <23733347+ChangeHow@users.noreply.github.com> Agent-Logs-Url: https://github.com/ChangeHow/suitup/sessions/10a4c896-542c-4baf-a45f-0ad1eecb2c8f --- src/setup.js | 2 +- tests/setup-ui.test.js | 54 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 tests/setup-ui.test.js diff --git a/src/setup.js b/src/setup.js index 76e4ad2..37115f3 100644 --- a/src/setup.js +++ b/src/setup.js @@ -172,7 +172,7 @@ export function getInitialStepValues(opts = {}) { } export async function runSetup({ defaults = false } = {}) { - p.intro(getWelcomeMessage()); + p.note(getWelcomeMessage(), "Welcome"); if (!isZshShell()) { p.log.error("Suitup setup must be run from zsh."); diff --git a/tests/setup-ui.test.js b/tests/setup-ui.test.js new file mode 100644 index 0000000..a62f274 --- /dev/null +++ b/tests/setup-ui.test.js @@ -0,0 +1,54 @@ +import { describe, test, expect, vi, beforeEach } from "vitest"; + +const { mockNote, mockIntro, mockOutro, mockError, mockInfo } = vi.hoisted(() => ({ + mockNote: vi.fn(), + mockIntro: vi.fn(), + mockOutro: vi.fn(), + mockError: vi.fn(), + mockInfo: vi.fn(), +})); + +vi.mock("@clack/prompts", () => ({ + note: mockNote, + intro: mockIntro, + outro: mockOutro, + cancel: vi.fn(), + isCancel: vi.fn(() => false), + multiselect: vi.fn(), + select: vi.fn(), + groupMultiselect: vi.fn(), + confirm: vi.fn(), + text: vi.fn(), + spinner: vi.fn(() => ({ start: vi.fn(), stop: vi.fn() })), + log: { + success: vi.fn(), + step: vi.fn(), + warn: vi.fn(), + error: mockError, + info: mockInfo, + }, +})); + +vi.mock("../src/utils/shell-context.js", () => ({ + isZshShell: vi.fn(() => false), +})); + +import { runSetup, getWelcomeMessage } from "../src/setup.js"; + +describe("setup welcome UI", () => { + beforeEach(() => { + vi.clearAllMocks(); + }); + + test("renders the welcome art inside a boxed note before shell validation", async () => { + await runSetup(); + + expect(mockNote).toHaveBeenCalledWith(getWelcomeMessage(), "Welcome"); + expect(mockIntro).not.toHaveBeenCalled(); + expect(mockError).toHaveBeenCalledWith("Suitup setup must be run from zsh."); + expect(mockInfo).toHaveBeenCalledWith( + 'Switch to zsh first: run `zsh` for this session or `chsh -s "$(which zsh)"` to make it your default shell.' + ); + expect(mockOutro).toHaveBeenCalledWith("No changes made."); + }); +});