diff --git a/src/ui/installMenu.test.js b/src/ui/installMenu.test.js index 4a0cf41..4b258b8 100644 --- a/src/ui/installMenu.test.js +++ b/src/ui/installMenu.test.js @@ -73,7 +73,7 @@ describe("InstallMenu", () => { action: installMenu.selectInstallPath, }, { - label: "Storage provider module: Disabled (todo)", + label: "Storage provider module: Disabled (Coming soon!)", action: installMenu.storageProviderOption, }, { diff --git a/src/ui/mainMenu.test.js b/src/ui/mainMenu.test.js index 7b9c6f8..e83665e 100644 --- a/src/ui/mainMenu.test.js +++ b/src/ui/mainMenu.test.js @@ -52,99 +52,6 @@ describe("mainmenu", () => { }); }); - describe("promptMainMenu", () => { - beforeEach(() => { - mainmenu.showRunningMenu = vi.fn(); - mainmenu.showNotRunningMenu = vi.fn(); - mainmenu.showNotInstalledMenu = vi.fn(); - }); - - it("shows running menu when number of codex processes is greater than zero", async () => { - mockProcessControl.getNumberOfCodexProcesses.mockResolvedValue(1); - - await mainmenu.promptMainMenu(); - - expect(mainmenu.showRunningMenu).toHaveBeenCalled(); - expect(mainmenu.showNotRunningMenu).not.toHaveBeenCalled(); - expect(mainmenu.showNotInstalledMenu).not.toHaveBeenCalled(); - }); - - it("shows not running menu when number of codex processes is zero and codex is installed", async () => { - mockProcessControl.getNumberOfCodexProcesses.mockResolvedValue(0); - mockInstaller.isCodexInstalled.mockResolvedValue(true); - - await mainmenu.promptMainMenu(); - - expect(mainmenu.showRunningMenu).not.toHaveBeenCalled(); - expect(mainmenu.showNotRunningMenu).toHaveBeenCalled(); - expect(mainmenu.showNotInstalledMenu).not.toHaveBeenCalled(); - }); - - it("shows not installed menu when number of codex processes is zero and codex is not installed", async () => { - mockProcessControl.getNumberOfCodexProcesses.mockResolvedValue(0); - mockInstaller.isCodexInstalled.mockResolvedValue(false); - - await mainmenu.promptMainMenu(); - - expect(mainmenu.showRunningMenu).not.toHaveBeenCalled(); - expect(mainmenu.showNotRunningMenu).not.toHaveBeenCalled(); - expect(mainmenu.showNotInstalledMenu).toHaveBeenCalled(); - }); - }); - - describe("showNotInstalledMenu", () => { - it("shows a menu with options to install Codex or exit", async () => { - await mainmenu.showNotInstalledMenu(); - - expect(mockUiService.askMultipleChoice).toHaveBeenCalledWith( - "Codex is not installed", - [ - { label: "Install Codex", action: mockInstallMenu.show }, - { label: "Exit", action: mockMenuLoop.stopLoop }, - ], - ); - }); - }); - - describe("showRunningMenu", () => { - it("shows a menu with options to stop Codex, open Codex app, upload, download, or exit", async () => { - await mainmenu.showRunningMenu(); - - expect(mockUiService.askMultipleChoice).toHaveBeenCalledWith( - "Codex is running", - [ - { label: "Open Codex app", action: mockCodexApp.openCodexApp }, - { label: "Stop Codex", action: mainmenu.stopCodex }, - { label: "Upload a file", action: mockDataMenu.performUpload }, - { label: "Download a file", action: mockDataMenu.performDownload }, - { - label: "Exit (Codex keeps running)", - action: mockMenuLoop.stopLoop, - }, - ], - ); - }); - }); - - describe("showNotRunningMenu", () => { - it("shows a menu with options to start Codex, configure, uninstall, or exit", async () => { - await mainmenu.showNotRunningMenu(); - - expect(mockUiService.askMultipleChoice).toHaveBeenCalledWith( - "Codex is installed but not running", - [ - { - label: "Start Codex", - action: mainmenu.startCodex, - }, - { label: "Edit Codex config", action: mockConfigMenu.show }, - { label: "Uninstall Codex", action: mockInstallMenu.show }, - { label: "Exit", action: mockMenuLoop.stopLoop }, - ], - ); - }); - }); - describe("process control", () => { const mockSpinner = { isMock: "yes",