mirror of
https://github.com/nexu-io/open-design.git
synced 2026-06-01 03:14:35 +07:00
PR #1306 routed artifacts whose source matches htmlNeedsSandboxShim() through buildSrcdoc(), which injects a localStorage / sessionStorage polyfill before any user script runs. Issue #1403 stayed open as a verification placeholder against the original repro shape — a React tree whose useState initializer reads localStorage in a sandboxed iframe. file-viewer-render-mode.test.ts already covers the routing decision. This commit closes the loop on the runtime payload: a real-shape React artifact is fed through buildSrcdoc, the produced doc is run inside a Node vm context whose window forbids Web Storage the same way an allow-scripts iframe does, and we assert (a) the bare sandbox raises SecurityError on access, (b) the shim takes over and exposes a working in-memory store, (c) the original boot script that read localStorage from initializers runs cleanly, and (d) the shim does NOT clobber a working native storage when one is present (the allow-same-origin path stays untouched). Also pins shim ordering — the shim script must appear before the first user storage read for the polyfill to be effective. |
||
|---|---|---|
| .. | ||
| app-route-export.test.ts | ||
| design-template-deck-nav.test.ts | ||
| exports.test.ts | ||
| file-ops.test.ts | ||
| in-project-link.test.ts | ||
| jsx-module-refs.test.ts | ||
| markdown.linkClick.test.tsx | ||
| markdown.test.tsx | ||
| plugin-source.test.ts | ||
| react-component.test.ts | ||
| srcdoc-bridge-empty-targets.test.ts | ||
| srcdoc-deck-bridge-framework-deck.test.ts | ||
| srcdoc-deck-bridge-nested-slides.test.ts | ||
| srcdoc-palette-css-vars.test.ts | ||
| srcdoc-sandbox-shim.test.ts | ||
| srcdoc-transport.test.ts | ||
| srcdoc.test.ts | ||
| todos.test.ts | ||
| tool-renderers.test.tsx | ||