Files
zerobyte/app/client/lib/volume-path.test.ts
Nico 8fcd446926 refactor: snapshot strip out base path (#542)
* refactor: strip out volume path in snapshot list / restore

chore: lint issue

* test: backups new include patterns
2026-02-18 21:45:19 +01:00

29 lines
730 B
TypeScript

import { describe, expect, test } from "bun:test";
import { getVolumeMountPath } from "./volume-path";
import { fromAny } from "@total-typescript/shoehorn";
describe("getVolumeMountPath", () => {
test("returns the configured path for directory volumes", () => {
const volume = {
shortId: "abc123",
config: {
backend: "directory",
path: "/mnt/data/projects",
},
};
expect(getVolumeMountPath(fromAny(volume))).toBe("/mnt/data/projects");
});
test("returns the mounted data path for non-directory volumes", () => {
const volume = {
shortId: "vol789",
config: {
backend: "nfs",
},
};
expect(getVolumeMountPath(fromAny(volume))).toBe("/var/lib/zerobyte/volumes/vol789/_data");
});
});