Skip to content

test: no automated test of the web component on another origin #825

Open

Description

@bpowers

No automated test loads the embeddable web component, sd-component.js, into a page on a different origin and checks that the engine starts and simulates.
That broke once in production (#688: embeds showed data but the engine never initialized), and today only a manual step in the post-deploy checklist would catch it again.

Why it matters

The cross-origin path depends on bundler behaviour that an rspack upgrade or config change can quietly alter: rspack turns module workers into classic workers in UMD builds, and inside a worker started from a blob URL its automatic publicPath resolves to the embedding page's origin.
src/engine/src/worker-trampoline.ts works around both; nothing tests the built bundle end to end.
scripts/validate-app-prod-config.mjs checks the /static CORS header and src/engine/tests/worker-trampoline.test.ts unit-tests the trampoline, but neither shows a real cross-origin page booting the engine.

Fix

A Playwright test with two local origins, no GAE needed:

  • Origin A (127.0.0.1:<port>) serves the built public/static assets with Access-Control-Allow-Origin: *, as app.yaml does.
  • Origin B (localhost:<port>) serves a minimal page that loads sd-component.js from origin A.
  • Assert that a simulation result appears and that the WASM was fetched from origin A.

It could run in the CI frontend job after the build it already does.
A version of this harness was built by hand while fixing #688 but never checked in.

Pointers

Activity

  1. added
    frontend
    on Oct 12, 2026
  2. changed the title [-]test: no automated cross-origin embed regression test for sd-component.js (follow-up to #688)[/-] [+]test: no automated test of the web component on another origin[/+] on Oct 12, 2026
  3. added
    ci
    enhancement
    on Oct 12, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    cienhancementfrontend

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions