mirror of
https://github.com/getpaseo/paseo.git
synced 2026-10-14 13:22:37 +00:00
test(server): reproduce directory symlink misclassification
Preserve the test2 -> ./test example from #1891. Directory listings classify the link as a file, so the explorer opens it instead of expanding it. The reported missing row was not reproduced on Linux desktop 0.11.2; this branch intentionally retains a failing test without changing production behavior.
This commit is contained in:
@@ -12,6 +12,32 @@ async function createTempDir(prefix: string): Promise<string> {
|
||||
}
|
||||
|
||||
describe.skipIf(isPlatform("win32"))("service POSIX-only", () => {
|
||||
it("lists and expands the reported relative directory symlink", async () => {
|
||||
const root = await createTempDir("paseo-file-explorer-");
|
||||
|
||||
try {
|
||||
await mkdir(path.join(root, "test"));
|
||||
await writeFile(path.join(root, "test", "x.txt"), "inside\n", "utf-8");
|
||||
await symlink("./test", path.join(root, "test2"));
|
||||
|
||||
const listing = await listDirectoryEntries({ root });
|
||||
expect(listing.entries.find((entry) => entry.name === "test2")).toMatchObject({
|
||||
path: "test2",
|
||||
kind: "directory",
|
||||
});
|
||||
|
||||
const expanded = await listDirectoryEntries({ root, relativePath: "test2" });
|
||||
expect(expanded.path).toBe("test2");
|
||||
expect(expanded.entries.map((entry) => entry.name)).toEqual(["x.txt"]);
|
||||
expect(await readExplorerFile({ root, relativePath: "test2/x.txt" })).toMatchObject({
|
||||
path: "test2/x.txt",
|
||||
content: "inside\n",
|
||||
});
|
||||
} finally {
|
||||
await rm(root, { recursive: true, force: true });
|
||||
}
|
||||
});
|
||||
|
||||
it("lists directory entries even when a dangling symlink exists", async () => {
|
||||
const root = await createTempDir("paseo-file-explorer-");
|
||||
|
||||
|
||||
Reference in New Issue
Block a user