Skip to content

test(web): exercise feature settings through real browser owners - #46102

Merged
hyoban merged 3 commits into
mainfrom
test/cleanup-20261111-2252-burn2
Nov 12, 2026
Merged

hyoban merged 3 commits into
mainfrom
test/cleanup-20261111-2252-burn2

Conversation

@hyoban

@hyoban hyoban commented Nov 11, 2026 •

Copy link
Copy Markdown
Member

The legacy feature-setting tests asserted callbacks or fabricated catalogs/players, and repeated child-layer scenarios. This cleanup audits 11 unit specs plus the existing Follow-up browser spec, consolidating them into 9 browser behavior domains with real feature stores, controls, catalogs and query owners. Follow web/docs/test.md.

Per-file quality changes (paths below share web/app/components/base/features/new-feature-panel/):

Existing spec Result and concrete improvement
file-upload/__tests__/index.spec.tsx Browser: native hover/settings/cancel/summary replace synthetic mouse events and private parent queries; real enabled/legacy-image state replaces callback counts; readonly inputs remain inert.
file-upload/__tests__/setting-content.spec.tsx Folded into settings Browser owner: local draft, saved upload method/types/limit, invalid empty type selection and image defaults are proved through real popovers, native inputs and actual saved feature data.
file-upload/__tests__/setting-modal.spec.tsx Browser: both Cancel and Close remove the portal, restore focus, reopen the unchanged draft, then save and reopen persisted values. Callback assertions are removed.
image-upload/__tests__/index.spec.tsx Browser: real pointer hover, image-only settings/defaults, cancel and saved summary replace fake events/query responses; legacy image and readonly behavior use the real feature store.
text-to-speech/__tests__/index.spec.tsx Browser: real AudioBtn remains mounted when settings are reached; the real feature store and visible voice preferences prove disable/enable preservation and readonly controls.
text-to-speech/__tests__/voice-settings.spec.tsx Browser settings owner: native listbox keyboard focus/selection, close/removal/focus/reopen and actual voice/autoplay persistence replace the player-manager double.
text-to-speech/__tests__/param-config-content.spec.tsx Folded into voice settings: real language catalog, route-specific generated queries and native audio playback replace catalog/player doubles; removed-voice fallback is pinned at the HTTP stream and visible Playing/Play states; no-route query guard remains.
__tests__/follow-up.spec.tsx Folded into existing Browser owner: actual store commits and reopened prompt replace callbacks; enabled and readonly behavior retain native keyboard/focus evidence.
__tests__/follow-up-setting-modal.spec.tsx Browser prompt/parameter domains: actual saved default/custom model/prompt and omission of disabled max tokens replace captured callback data fed back into rerender; reopening proves persistence.
__tests__/follow-up.browser.spec.tsx Existing Browser suite strengthened with real English resources, guarded requests, shared query preset and actual saved state. Its keyboard-only visible trigger, textarea arrow-key ownership, Escape reset and restored visible focus are retained.
annotation-reply/__tests__/annotation-ctrl-button.spec.tsx Browser: rendered returned annotation identity and real success notification replace callback/toast doubles. Real quota modal and native hit testing expose the Close obstruction (tracked issue below). Empty-answer behavior uses a public prop transition.
annotation-reply/__tests__/config-param-modal.spec.tsx Browser: real model selection, native Tab/slider input, actual caller-saved settings and real error notifications replace save/hide/toast spies. Pending-close protection and rejection/retry remain; explicit zero is preserved.

Shared feature render and model-query presets are side-effect-free on import. Every retained mock is a documented router or HTTP boundary. No production changes, runner duplicates, allowlist additions or large files.

Scenario audit: redundant render/callback/child-layer rows were merged. Empty mocked language catalogs and a mocked catalog without sample text were dropped: the production static catalog is nonempty and supplies the rendered samples; manufacturing an absent catalog is outside this product contract. No race, rollback, queued-save, remote-sync or remote-response scenario was deleted. Pending saves, close protection, rejection recovery, retry, and existing keyboard ownership remain through public journeys. No feature-gap backfill.

Validation:

  • Focused Chromium: 9 files, 24 pass + 1 issue-linked expected failure; workers capped at 2.
  • 14/14 sequential targeted mutations caught; all production files restored byte-for-byte.
  • Browser policy guard passes; allowlist removed 0 / added 0.
  • Full root vp run -w check and Web type-check pass.

Remediation: the original 8 queue files remain occupied by open PRs; PAT remediation also requires the policy file currently occupied by #46058. None of those paths is changed. Initial inventory checked 679 open PRs / 13,487 fully expanded paths; final refresh checked 678 / 13,485, with zero changed-path conflicts.

Production issue: #46103 (annotation quota Close is covered by GridMask content; existing close case retained as it.fails). Guide PR: none needed; existing test.md covers the findings.

Final CI: https://github.com/langgenius/dify/actions/runs/43046916146 — all Actions green; required checks 9 success / 2 configured skips. WebKit smoke and Chromium E2E 1/3 initially failed downloading the prebuilt Web artifact before tests started; one failed-jobs-only rerun passed. No CI source-fix round.

Codecov Web data is complete (12/12 sessions): 90.14%, displayed +0.00% versus main, +8 covered lines. The optional GitHub codecov/project/web publication is still pending although the reports are complete; patch and other project contexts pass. No padding, empty commit or coverage-upload rerun. Final head d4f5661b06; 3 ahead / 0 behind latest main; clean and matching local/origin/PR heads.

@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. and removed size:XXL This PR changes 1000+ lines, ignoring generated files. labels Nov 11, 2026
@github-actions github-actions Bot added the size:XXL This PR changes 1000+ lines, ignoring generated files. label 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 (179915a) to head (d4f5661).
⚠️ Report is 9 commits behind head on main.

Additional details and impacted files
@@           Coverage Diff           @@
##             main   #46102   +/-   ##
=======================================
  Coverage   90.14%   90.14%           
=======================================
  Files        6307     6307           
  Lines      394780   394780           
  Branches    79187    79187           
=======================================
+ Hits       355873   355881    +8     
+ Misses      32790    32782    -8     
  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 4a7d129 Nov 12, 2026
98 of 103 checks passed
@hyoban
hyoban deleted the test/cleanup-20261111-2252-burn2 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