test(line): align tmp-root expectation after sandbox hardening

This commit is contained in:
Peter Steinberger
2026-02-24 23:31:15 +00:00
parent 79e2328935
commit 79a7b3d22e
2 changed files with 3 additions and 3 deletions

View File

@@ -1,7 +1,7 @@
import fs from "node:fs";
import os from "node:os";
import path from "node:path";
import { beforeEach, describe, expect, it, vi } from "vitest";
import { resolvePreferredOpenClawTmpDir } from "../infra/tmp-openclaw-dir.js";
const getMessageContentMock = vi.hoisted(() => vi.fn());
@@ -54,7 +54,7 @@ describe("downloadLineMedia", () => {
expect(writtenPath).not.toContain(messageId);
expect(writtenPath).not.toContain("..");
const tmpRoot = path.resolve(os.tmpdir());
const tmpRoot = path.resolve(resolvePreferredOpenClawTmpDir());
const rel = path.relative(tmpRoot, path.resolve(writtenPath));
expect(rel === ".." || rel.startsWith(`..${path.sep}`)).toBe(false);
});