test: tighten diffs artifact assertions

This commit is contained in:
Peter Steinberger
2026-05-08 14:11:26 +01:00
parent 190c07afe9
commit c7cf34a955
2 changed files with 5 additions and 3 deletions

View File

@@ -68,7 +68,7 @@ describe("diffs tool rendered output guards", () => {
});
expect(screenshotter.screenshotHtml).toHaveBeenCalledTimes(1);
expect((result?.details as Record<string, unknown>).filePath).toEqual(expect.any(String));
expect((result?.details as Record<string, unknown>).filePath).toMatch(/preview\.png$/);
});
});

View File

@@ -190,8 +190,10 @@ describe("diffs tool", () => {
});
expectArtifactOnlyFileResult(screenshotter, result);
expect((result?.details as Record<string, unknown>).artifactId).toEqual(expect.any(String));
expect((result?.details as Record<string, unknown>).expiresAt).toEqual(expect.any(String));
expect(requireString(readDetails(result).artifactId, "artifactId")).toMatch(/^[a-f0-9]{20}$/u);
expect(requireString(readDetails(result).expiresAt, "expiresAt")).toMatch(
/^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}\.\d{3}Z$/u,
);
});
it("honors ttlSeconds for artifact-only file output", async () => {