mirror of
https://github.com/Alvin-Zilverstand/return-youtube-dislike.git
synced 2026-10-28 07:40:27 +01:00
e500088e65
Add Firefox data consent, repair contributor sign-in, and introduce optional Hide clutter buttons. Harden video navigation, voting, and action layouts with shared browser regression coverage and reproducible release packaging.
45 lines
1.4 KiB
JavaScript
45 lines
1.4 KiB
JavaScript
/**
|
|
* @jest-environment node
|
|
*/
|
|
|
|
const {
|
|
annotateVisualEvidence,
|
|
assertVisualEvidenceCaptured,
|
|
captureOptionalVisualEvidence,
|
|
} = require("./visual-evidence");
|
|
|
|
test("capture-off results cannot be presented as inspected screenshot evidence", async () => {
|
|
const capture = jest.fn();
|
|
const testInfo = { annotations: [] };
|
|
|
|
const evidence = await captureOptionalVisualEvidence({
|
|
capture,
|
|
environment: {},
|
|
outputPath: "would-have-been.png",
|
|
});
|
|
annotateVisualEvidence(testInfo, evidence);
|
|
|
|
expect(capture).not.toHaveBeenCalled();
|
|
expect(evidence).toEqual({ captured: false, outputPath: null, reason: "capture-disabled" });
|
|
expect(testInfo.annotations).toEqual([{ description: "not-captured:capture-disabled", type: "visual-evidence" }]);
|
|
expect(() => assertVisualEvidenceCaptured(evidence, "Extension UI screenshot")).toThrow(
|
|
"Structural browser assertions alone are not inspected screenshot evidence.",
|
|
);
|
|
});
|
|
|
|
test("capture-on results carry the exact screenshot path", async () => {
|
|
const capture = jest.fn();
|
|
const evidence = await captureOptionalVisualEvidence({
|
|
capture,
|
|
environment: { RYD_CAPTURE_VISUALS: "1" },
|
|
outputPath: "captured.png",
|
|
});
|
|
|
|
expect(capture).toHaveBeenCalledWith("captured.png");
|
|
expect(assertVisualEvidenceCaptured(evidence)).toEqual({
|
|
captured: true,
|
|
outputPath: "captured.png",
|
|
reason: null,
|
|
});
|
|
});
|