chore(dev): expose core stores on window in dev builds for the QA harness

DEV-guarded (import.meta.env.DEV): the platform-bugs Playwright harness
drives store paths (property updates, group switches) the way the agent
tools do, which raw DOM access cannot reach. Production bundles never
ship it.
This commit is contained in:
David Montero 2026-08-15 08:29:39 +02:00
parent 941df93cb3
commit d78266011d
1 changed files with 19 additions and 0 deletions

View File

@ -89,3 +89,22 @@ if (import.meta.env.VITE_DESKTOP) {
.then((m) => m.mountDesktop?.())
.catch((err) => console.warn('[desktop] failed to load hooks:', err));
}
// DEV-only: expose the core stores for E2E harnesses (the platform-bugs QA
// harness drives the STORE paths — property updates, group switches — the
// way the agent tools do, which raw DOM access cannot reach). Guarded by
// import.meta.env.DEV so production bundles never ship it.
if (import.meta.env.DEV) {
Promise.all([
import('./store/useSimulatorStore'),
import('./store/useEditorStore'),
import('./store/useElectricalStore'),
]).then(([sim, ed, el]) => {
(window as unknown as Record<string, unknown>).__velxioStores = {
useSimulatorStore: sim.useSimulatorStore,
useEditorStore: ed.useEditorStore,
useElectricalStore: el.useElectricalStore,
getBoardSimulator: sim.getBoardSimulator,
};
});
}