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:
@@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user