Skip to content

test(web): exercise shared controls through real browser owners - #46099

Merged
hyoban merged 4 commits into
mainfrom
test/cleanup-20261111-2215-burn1
Nov 12, 2026
Merged

hyoban merged 4 commits into
mainfrom
test/cleanup-20261111-2215-burn1

Conversation

@hyoban

@hyoban hyoban commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

This test-only batch replaces old engine/callback doubles with real Browser Mode behavior across console controls. Seven existing rendered unit suites move into Browser coverage (Sort joins and improves its existing Browser owner). The theme selector's separate SSR HTML contract stays in unit.

Per-file improvements:

Existing spec Result and browser evidence
base/carousel/__tests__/index.spec.tsx Real Embla replaces its fake API/listener registry. Actual horizontal/vertical slide geometry, next/previous/dot movement, selected indicators and disabled endpoints replace option/ref/subscription/call assertions.
base/infinite-scroll-sentinel/__tests__/index.spec.tsx Real IntersectionObserver and scroll geometry prove fixed/container-derived preloading before visibility. Pause/resume uses the current caller and rendered results; observer constructor/cleanup spies are removed.
base/sort/__tests__/index.spec.tsx + existing Browser owner Live controlled values replace callback-only/frozen-prop assertions. Native keyboard selection, menu removal, restored focus, numeric field identifiers and direction preservation; original narrow RTL readable-label/control geometry retained with a real caller.
base/keyboard-sortable/__tests__/use-keyboard-sortable.spec.tsx Native focus follows moved items through commit/cancel, permission and prop replacement. Saved caller output replaces callback counts; state-dependent keyboard sequences are split by awaited focus/ARIA outcomes.
Notion credential-selector/__tests__/index.spec.tsx Two rows become one native keyboard journey through a real controlled caller: fallback label, saved credential, closed portal, restored focus and selected option after reopening.
base/date-time-picker/__tests__/localization.spec.tsx Real browser locale/calendar/listbox behavior; document direction isolated per test. Localized assistive close name plus Escape/removal/reopen/focus and retained saved time replace a programmatic .click() and negative callback assertion.
features/theme/__tests__/theme-selector.spec.tsx Real ThemeProvider replaces the next-themes facade. Theme choices prove document theme, persisted preference, reopened radio selection and restored focus. SSR HTML remains a separate unit-only scenario because it needs no browser.

Every Browser file stays below 500 lines, with no owned-module mocks, forced interactions or real network. No production change, new feature coverage or gap backfill is included. The batch deliberately stays below 10 source suites: PAT remediation and its required guard deletions are deferred while #46058 occupies the policy file. No guard allowance is added or changed.

Redundant render/option/ref/listener/cleanup/callback rows were merged or dropped. No race, rollback, queued-save, remote-sync or remote-response case was deleted. Existing keyboard permission/prop replacement and current callback behavior are preserved.

Validation on latest main: 7 focused Browser files / 21 tests, 1 SSR unit test, the Browser policy guard, complete root vp run -w check, Web type-check and the normal commit hook pass. The TimePicker caller's nullable value type was corrected after the initial type-check, then the check passed. No full local Vitest suite, dev server or watcher was started; Browser workers were capped at two, unit at four.

Sequential production mutations: 9/9 caught — carousel movement/axis, intersection preloading/current callback, selected sort field, saved keyboard order, credential selection, picker locale and real theme persistence. Every production target was restored byte-for-byte.

Follow-ups: Notion page-tree expansion/preview are deferred after a temporary Chromium probe confirmed that native Tab skips their click-only div controls. Tracking issue: #46100. The existing row suite carries the migration TODO; that comment-only change is not counted as cleanup work. No guide change is needed: web/docs/test.md already covers the principles used here.

Final CI: head bc3d1f3e51 normally merges latest main b97da5a2c4. The main pipeline 43040637932 passed; required checks are 9 success / 2 configured skips. Web static/types, all four unit shards, both Browser shards, build/bundle comparison and E2E passed without a flaky-job rerun or CI fix round. Codecov project/web is green at 90.14% (+0.00% displayed versus b97da5a); all five project contexts are green. The optional codecov/patch check is still in progress even though the public API reports complete coverage with 12 sessions and zero coverable patch lines. This publication state is reported as pending; no empty commit, padding or workflow rerun was used.

@hyoban hyoban added the test-cleanup Web test cleanup / Browser Mode migration label Nov 11, 2026
@github-actions github-actions Bot added size:XXL This PR changes 1000+ lines, ignoring generated files. web This relates to changes on the web. labels Nov 11, 2026
@codecov

codecov Bot commented Nov 11, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 90.14%. Comparing base (b97da5a) to head (bc3d1f3).
⚠️ Report is 10 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #46099      +/-   ##
==========================================
- Coverage   90.14%   90.14%   -0.01%     
==========================================
  Files        6307     6307              
  Lines      394780   394778       -2     
  Branches    79187    79187              
==========================================
- Hits       355886   355866      -20     
- Misses      32777    32795      +18     
  Partials     6117     6117              
Flag Coverage Δ
dify-ui 92.65% <ø> (ø)
web 90.13% <ø> (-0.01%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@hyoban
hyoban marked this pull request as ready for review November 12, 2026 02:14
@hyoban
hyoban added this pull request to the merge queue Nov 12, 2026
Merged via the queue into main with commit 2dd7506 Nov 12, 2026
62 checks passed
@hyoban
hyoban deleted the test/cleanup-20261111-2215-burn1 branch November 12, 2026 02:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

size:XXL This PR changes 1000+ lines, ignoring generated files. test-cleanup Web test cleanup / Browser Mode migration web This relates to changes on the web.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants