"fixed" kicad tests, added baseline screenshots.

This commit is contained in:
Viktor Vaczi 2026-06-10 17:37:58 +02:00
commit d7159b42c0
39 changed files with 29 additions and 14 deletions

View file

@ -1,25 +1,33 @@
// Browser bundle entry for the collab e2e: bundles the generic reconciler + Yjs +
// BroadcastChannel transport (from the web frontend) into a single IIFE that the
// pl_editor static harness page can load via <script>. esbuild resolves `yjs` from
// tests/node_modules.
// BroadcastChannel transport (from the web standalone editor) into a single IIFE
// that the pl_editor static harness page can load via <script>. esbuild resolves
// `yjs` from tests/node_modules.
//
// Build: npm run build:collab (tests/) → tests/apps/kicad/collab-bundle.js
import {
startCollab,
type CollabModule,
type CollabWindow,
} from "../../web/apps/frontend/src/wasm/collab/index";
} from "../../web/standalone/src/wasm/collab/index";
// The e2e harness API predates the provider abstraction: specs pass a flat
// { channel, settleMs }. Translate to startCollab's ProviderConfig form here so
// the spec/harness callsites stay stable across web-side API evolution.
function start(
mod: CollabModule,
win: CollabWindow,
opts: { channel: string; settleMs?: number },
): ReturnType<typeof startCollab> {
return startCollab(mod, win, {
provider: { kind: "broadcastchannel", settleMs: opts.settleMs },
room: opts.channel,
});
}
declare global {
interface Window {
KicadCollab?: {
start: (
mod: CollabModule,
win: CollabWindow,
opts: { channel: string; settleMs?: number },
) => ReturnType<typeof startCollab>;
};
KicadCollab?: { start: typeof start };
}
}
window.KicadCollab = { start: startCollab };
window.KicadCollab = { start };

View file

@ -14,6 +14,10 @@ await build({
format: "iife",
outfile: path.join(testsDir, "apps/kicad/collab-bundle.js"),
nodePaths: [path.join(testsDir, "node_modules")],
// The e2e harness only exercises the BroadcastChannel transport; the server
// providers are reached via dynamic import() that never runs in tests, and
// their packages are only installed in the web/ pnpm workspace.
external: ["y-partyserver/provider", "@hocuspocus/provider"],
logLevel: "info",
target: "es2020",
});