* fix(hopper): normalize string-backed addresses and update verification * feat(native): add inspection primitives, dispatch traces and approved UI observation * test: prioritize real artifact E2E and captured golden regressions * fix(process): queue observed output before reactive rendering actions * test: prune redundant cases and strengthen boundary assertions * fix(cli): route native value tracing through shared workflows * test: replace synthetic success with real workflows and captured data * fix(catalog): separate portable metadata from native host availability
41 lines
1.2 KiB
TypeScript
41 lines
1.2 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
|
|
import {
|
|
captureWebScreenshotInputSchema,
|
|
compareWebScreenshotsInputSchema,
|
|
createWebScreenshotArtifact,
|
|
} from "./webScreenshot.js";
|
|
|
|
describe("inline web screenshots", () => {
|
|
it("rejects removed screenshot size and pixel controls", () => {
|
|
expect(
|
|
captureWebScreenshotInputSchema.safeParse({
|
|
cdp_endpoint: "http://127.0.0.1:9222",
|
|
allowed_origins: ["https://app.example.test"],
|
|
target_id: "page-1",
|
|
maximum_image_bytes: 1,
|
|
}).success,
|
|
).toBe(false);
|
|
|
|
const artifact = createWebScreenshotArtifact(Buffer.from("image"));
|
|
expect(
|
|
compareWebScreenshotsInputSchema.safeParse({
|
|
before: artifact,
|
|
after: artifact,
|
|
maximum_pixels: 1,
|
|
}).success,
|
|
).toBe(false);
|
|
});
|
|
|
|
it("accepts a caller-supplied target ID without a length ceiling", () => {
|
|
const targetId = "target-".repeat(100);
|
|
expect(
|
|
captureWebScreenshotInputSchema.parse({
|
|
cdp_endpoint: "http://127.0.0.1:9222",
|
|
allowed_origins: ["https://app.example.test"],
|
|
target_id: targetId,
|
|
}).target_id,
|
|
).toBe(targetId);
|
|
});
|
|
});
|