feat(hosts): manage servers and encrypted SSH credentials in UI (#7)

This commit is contained in:
Florian Schmidt
2026-11-16 10:19:52 +01:00
parent 4fe7e4e376
commit 4d9a632625
22 changed files with 1779 additions and 81 deletions
+13
View File
@@ -44,3 +44,16 @@ it("starts before notebooks exists and cancels pending notifications on close",
await new Promise((r) => setTimeout(r, 600)); expect(listener).not.toHaveBeenCalled();
} finally { await watcher.close(); await rm(dir, { recursive: true, force: true }); }
});
it("publishes hosts.yaml changes, atomic replacements and deletion", async () => {
const dir = await mkdtemp(join(tmpdir(), "shellbook-hostwatch-"));
const file = join(dir, "hosts.yaml"); await writeFile(file, "[]");
const watcher = createNotebookWatcher(dir, { debounceMs: 10 });
const events: NotebookFileEvent[] = []; watcher.on(e => events.push(e));
try {
await watcher.ready; await writeFile(file + ".tmp", "# changed\n[]"); await rename(file + ".tmp", file);
await vi.waitFor(() => expect(events).toContainEqual({ type: "file.changed", path: "hosts.yaml" }));
await rm(file);
await vi.waitFor(() => expect(events).toContainEqual({ type: "file.deleted", path: "hosts.yaml" }));
} finally { await watcher.close(); await rm(dir, { recursive: true, force: true }); }
});