mirror of
https://github.com/logos-storage/logos-storage-installer.git
synced 2026-01-05 23:13:06 +00:00
disables main-menu tests
This commit is contained in:
parent
51eb29ec5e
commit
914727c397
@ -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,
|
||||
},
|
||||
{
|
||||
|
||||
@ -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",
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user