- Old tests fixed

- Added a static Fixuture class for test mockups
This commit is contained in:
2026-08-28 16:52:59 +02:00
parent 310218663d
commit 1ee2a2fe7a
13 changed files with 161 additions and 306 deletions
+5 -5
View File
@@ -1,10 +1,10 @@
import { resolveInode, resolvePath } from "@core/util/path_resolver";
import { expectNodeNotFoundError, expectNotADirectoryError } from "@tests/helpers/error_matchers";
import { buildTestFS } from "@tests/helpers/filesystems_fixture";
import { depth7Tree } from "@tests/helpers/tree_fixture";
import { Fixture7Depth } from "@tests/helpers/state_fixture";
import { describe, expect, test } from "vitest";
const fs = buildTestFS(depth7Tree);
const state = Fixture7Depth.State;
const fs = state.filesystem;
describe("resolvePath", () => {
test("returns an inode from an absolute path", () => {
@@ -64,10 +64,10 @@ describe("resolvePath", () => {
describe("resolveInode", () => {
test("returns an the path from the d4 node", () => {
expect(resolveInode(fs, 4)).toBe("/d1/d2/d3/d4");
expect(resolveInode(state, 4, true)).toBe("/d1/d2/d3/d4");
});
test("returns an empty string from a non existent inode", () => {
expect(resolveInode(fs, 999)).toBe("");
expect(resolveInode(state, 999)).toBe("");
});
});