From 6cd3a16d11085c2c157c2c946366997af89bbe66 Mon Sep 17 00:00:00 2001 From: Austin Date: Mon, 21 Sep 2026 07:40:47 -0500 Subject: [PATCH 01/21] test(ui): add cross-browser shadow DOM coverage --- .changeset/calm-browsers-test.md | 2 + .github/workflows/storybook.yml | 32 +++++++++++ docs/shadow-dom-consumer-compatibility.md | 27 +++++---- docs/shadow-dom-isolation-plan.md | 37 ++++++------ packages/ui/package.json | 3 +- ...ionAuthButton.shadow-isolation.stories.tsx | 3 +- ...ersion-picker.shadow-isolation.stories.tsx | 57 +++++++++++++------ ...compatibility.shadow-isolation.stories.tsx | 8 +-- ...oduction-seam.shadow-isolation.stories.tsx | 8 +-- ...adow-root-host-realistic-usage.stories.tsx | 2 +- ...ign-in-dialog.shadow-isolation.stories.tsx | 13 +++-- ...ction-popover.shadow-isolation.stories.tsx | 4 +- packages/ui/vitest.config.ts | 10 +++- 13 files changed, 138 insertions(+), 68 deletions(-) create mode 100644 .changeset/calm-browsers-test.md diff --git a/.changeset/calm-browsers-test.md b/.changeset/calm-browsers-test.md new file mode 100644 index 00000000..a845151c --- /dev/null +++ b/.changeset/calm-browsers-test.md @@ -0,0 +1,2 @@ +--- +--- diff --git a/.github/workflows/storybook.yml b/.github/workflows/storybook.yml index 56e947c3..9aa45f7f 100644 --- a/.github/workflows/storybook.yml +++ b/.github/workflows/storybook.yml @@ -39,3 +39,35 @@ jobs: YVP_APP_KEY: ${{ secrets.YVP_APP_KEY }} STORYBOOK_YOUVERSION_API_HOST: ${{ secrets.YVP_API_HOST }} STORYBOOK_YOUVERSION_APP_KEY: ${{ secrets.STORYBOOK_YOUVERSION_APP_KEY }} + + shadow-browser-tests: + name: Shadow DOM (${{ matrix.browser }}) + runs-on: ubuntu-latest + container: + image: mcr.microsoft.com/playwright:v1.56.1-noble + strategy: + fail-fast: false + matrix: + browser: [firefox, webkit] + env: + VITEST_BROWSER: ${{ matrix.browser }} + STORYBOOK_YOUVERSION_APP_KEY: ${{ secrets.STORYBOOK_YOUVERSION_APP_KEY }} + STORYBOOK_AUTH_REDIRECT_URL: ${{ secrets.STORYBOOK_AUTH_REDIRECT_URL }} + steps: + - uses: actions/checkout@v5 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - uses: actions/setup-node@v6 + with: + node-version: 24 + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build packages + run: pnpm build + + - name: Run Shadow DOM browser tests + run: cd packages/ui && pnpm run test:shadow-browser diff --git a/docs/shadow-dom-consumer-compatibility.md b/docs/shadow-dom-consumer-compatibility.md index 7f356783..8c51d152 100644 --- a/docs/shadow-dom-consumer-compatibility.md +++ b/docs/shadow-dom-consumer-compatibility.md @@ -2,9 +2,9 @@ ## Purpose -This contract records the Chromium evidence for consumer-facing behavior at the -SDK's Shadow DOM boundary. It is input to YPE-5356's production rollout policy, -not approval for automatic isolation beyond `YouVersionAuthButton`. +This contract records cross-browser evidence for consumer-facing behavior at +the SDK's Shadow DOM boundary. It is input to YPE-5356's production rollout +policy, not approval for automatic isolation beyond `YouVersionAuthButton`. The executable evidence lives in `consumer-compatibility.shadow-isolation.stories.tsx`. The existing @@ -30,7 +30,7 @@ exercise. They do not establish compatibility for every SDK component. | --- | --- | --- | | A light-DOM form natively owns or serializes a control inside an SDK shadow root | Unsupported | `FormsAndExternalRelationshipsStopAtTheTreeScope` verifies that the isolated textarea has no owner form, is absent from `form.elements`, and is absent from `FormData`. A rollout target that needs form participation requires an explicit component API or separately designed form-associated host contract. | | A light-DOM `