fix: normalize bridge errors and support nested group paths

Distinguish invalid KeePass requests from backend failures in the Python bridge, improve nested group path resolution, and add coverage for nested group creation plus payload forwarding.
This commit is contained in:
matmoul committed 2026-05-10 00:56:58 +02:00
1 parent ee0e2c85f4
commit 5fa30414d7
8 files changed
+99 -23

No files matched your search

+22
View File
@@ -166,6 +166,28 @@ test("creates entries in a temporary copy of the bundled fixture and persists th
});
test("creates nested groups on a temporary copy", async () => {
const [{ password }, pykeepassReady] = await Promise.all([
readFile(FIXTURE_DATA_PATH, "utf8").then((raw) => JSON.parse(raw) as FixtureData),
ensurePyKeePass(),
]);
if (!pykeepassReady) {
console.log("Skipping integration test: pykeepass is not installed");
return;
}
await withTempCopy(FIXTURE_PATH, async (tempPath) => {
const db = openKeePassDatabase(tempPath, { password });
const createdGroup = await db.createGroup({ name: "Nested", path: "Folder1" });
expect(createdGroup.path).toBe("Folder1/Nested");
const groups = await db.listGroups();
expect(groups.some((group) => group.path === "Folder1/Nested")).toBe(true);
});
});
test("uses the JSON fixture content as the source of truth for expectations", async () => {
const { content } = JSON.parse(await readFile(FIXTURE_DATA_PATH, "utf8")) as FixtureData;