test: audit existing suite

This commit is contained in:
Federico Jaramillo Martinez
2026-07-03 09:48:20 +02:00
parent 45d9f4360a
commit 1564f1cfc5
37 changed files with 256 additions and 231 deletions
+16 -2
View File
@@ -18,9 +18,23 @@ afterEach(async () => {
describe("PI WEB config persistence", () => {
it("writes and reads the configured PI WEB config path", () => {
const saved = savePiWebConfig({ host: "0.0.0.0", port: 9000, allowedHosts: ["example.local"], shortcuts: { "core:view.chat": "mod+1", "core:session.stop": null }, plugins: { "workspace-tasks": { enabled: false, settings: { configPath: ".pi-web/tasks.json" } } }, pathAccess: { allowedPaths: ["/tmp", "~/SDKs"] }, uploads: { defaultFolder: "manual\\incoming" } }, testOptions());
const requestedConfig = {
host: "0.0.0.0",
port: 9000,
allowedHosts: ["example.local"],
shortcuts: { "core:view.chat": "mod+1", "core:session.stop": null },
plugins: { "workspace-tasks": { enabled: false, settings: { configPath: ".pi-web/tasks.json" } } },
pathAccess: { allowedPaths: ["/tmp", "~/SDKs"] },
uploads: { defaultFolder: "manual\\incoming" },
};
const normalizedConfig = {
...requestedConfig,
uploads: { defaultFolder: "manual/incoming" },
};
expect(saved).toEqual({ path: configPath, exists: true, config: { host: "0.0.0.0", port: 9000, allowedHosts: ["example.local"], shortcuts: { "core:view.chat": "mod+1", "core:session.stop": null }, plugins: { "workspace-tasks": { enabled: false, settings: { configPath: ".pi-web/tasks.json" } } }, pathAccess: { allowedPaths: ["/tmp", "~/SDKs"] }, uploads: { defaultFolder: "manual/incoming" } } });
const saved = savePiWebConfig(requestedConfig, testOptions());
expect(saved).toEqual({ path: configPath, exists: true, config: normalizedConfig });
expect(loadPiWebConfig(testOptions())).toEqual(saved);
});