mirror of
https://github.com/morluto/rea
synced 2026-10-26 14:25:49 -04:00
20 lines
735 B
TypeScript
20 lines
735 B
TypeScript
import { expect, it } from "vitest";
|
|
|
|
import { BROWSER_TOOL_CONTRACTS } from "../../../src/contracts/browserToolContracts.js";
|
|
import { comparePngScreenshots } from "../../../src/browser/PngVisualDiff.js";
|
|
import { compareWebScreenshotsInputSchema } from "../../../src/domain/webScreenshot.js";
|
|
|
|
it("executes the advertised screenshot comparison example through PNG checksum validation", () => {
|
|
const contract = BROWSER_TOOL_CONTRACTS.find(
|
|
({ name }) => name === "compare_web_screenshots",
|
|
);
|
|
const input = compareWebScreenshotsInputSchema.parse(
|
|
contract?.examples[0]?.input,
|
|
);
|
|
expect(comparePngScreenshots(input)).toMatchObject({
|
|
status: "identical",
|
|
compared_pixels: 1,
|
|
changed_pixels: 0,
|
|
});
|
|
});
|