test(image-pipeline): add cpu webgl parity coverage

This commit is contained in:
Matthias
2026-04-04 22:16:08 +02:00
parent 195a812ba2
commit 455458cb1e
3 changed files with 624 additions and 0 deletions

View File

@@ -3,6 +3,7 @@
import { afterEach, beforeEach, describe, expect, it, vi } from "vitest";
import type { PipelineStep } from "@/lib/image-pipeline/contracts";
import { enforceCpuWebglParityGates } from "@/tests/image-pipeline/parity/fixtures";
function createCurvesStep(): PipelineStep {
return {
@@ -173,6 +174,8 @@ describe("webgl backend poc", () => {
}
it("selects webgl for preview when webgl is available and enabled", async () => {
enforceCpuWebglParityGates();
const webglPreview = vi.fn();
vi.doMock("@/lib/image-pipeline/backend/feature-flags", async () => {
@@ -224,6 +227,8 @@ describe("webgl backend poc", () => {
});
it("uses cpu for every step in a mixed pipeline request", async () => {
enforceCpuWebglParityGates();
vi.doMock("@/lib/image-pipeline/backend/feature-flags", async () => {
const actual = await vi.importActual<typeof import("@/lib/image-pipeline/backend/feature-flags")>(
"@/lib/image-pipeline/backend/feature-flags",