feat(FN-3398): update desktop README with multi-project setup and troublesh

The merge lands Step 7 of FN-3398, adding documentation and delivery artifacts across the mobile and desktop packages with updated READMEs, mobile-specific docs, and architecture references.

Fusion-Task-Id: FN-3398
This commit is contained in:
Fusion
2026-05-04 21:41:52 -07:00
committed by gsxdsm
parent 9699c3f2b6
commit 3feeb9026a
43 changed files with 2025 additions and 398 deletions

View File

@@ -0,0 +1,72 @@
import { beforeEach, describe, expect, it, vi } from "vitest";
const mockState = vi.hoisted(() => ({
content: new Map<string, string>(),
}));
vi.mock("electron", () => ({
app: {
getPath: vi.fn(() => "/tmp/fusion"),
},
}));
vi.mock("node:fs/promises", () => ({
readFile: vi.fn(async (path: string) => {
const value = mockState.content.get(path);
if (!value) {
const err = new Error("ENOENT") as NodeJS.ErrnoException;
err.code = "ENOENT";
throw err;
}
return value;
}),
writeFile: vi.fn(async (path: string, value: string) => {
mockState.content.set(path, value);
}),
rename: vi.fn(async (from: string, to: string) => {
const value = mockState.content.get(from) ?? "";
mockState.content.set(to, value);
}),
}));
describe("shell-settings", () => {
beforeEach(() => {
mockState.content.clear();
vi.resetModules();
});
it("returns defaults when file missing", async () => {
const { readShellSettings } = await import("../shell-settings.ts");
await expect(readShellSettings()).resolves.toEqual({
desktopMode: "remote",
activeProfileId: null,
profiles: [],
});
});
it("writes and reads persisted settings", async () => {
const { writeShellSettings, readShellSettings } = await import("../shell-settings.ts");
await writeShellSettings({
desktopMode: "local",
activeProfileId: "p1",
profiles: [
{
id: "p1",
name: "Local",
serverUrl: "http://127.0.0.1",
authToken: null,
createdAt: "2026-01-01T00:00:00.000Z",
updatedAt: "2026-01-01T00:00:00.000Z",
lastUsedAt: null,
},
],
});
await expect(readShellSettings()).resolves.toMatchObject({
desktopMode: "local",
activeProfileId: "p1",
profiles: [{ id: "p1" }],
});
});
});