fix: #3591401 Fix flaky video.spec.ts:21 by waiting for Drupal's auto-upload behavior to attach

Closes #3591401

What this MR does

Canvas.editComponentProp()'s file branch called setInputFiles() as soon as the managed-file <input type="file"> was visible, but Drupal core's fileAutoUpload behavior may not have bound its change → upload listener yet. Setting the file before then fires no upload AJAX, so the "Remove" button never renders and the assertion times out after 10s — failing on every retry on a slow runner.

The helper now waits for the input to carry data-once="auto-file-upload" before setting the file, mirroring the existing data-once="drupal-ajax" guard in CanvasMedia.addMediaImage(). This is a deterministic synchronization on the behavior that makes the upload work (rather than a longer timeout), and it fixes the race at the source for both upload sites in the test. The earlier networkidle workaround in video.spec.ts is therefore no longer needed and is removed.

Testing steps

  1. Run the video spec: tests/src/Playwright/tests/isolatedPerTest/video.spec.ts.
  2. Video Component › Can use a generic file widget to populate a video prop passes reliably — no 10s timeout waiting for the "remove" button at either upload site.

Notes for reviewers

  • Test-helper race only; no application code changes.

AI-Generated: Yes — used Claude Code (Claude Opus 4.8) to diagnose the upload race and write the fix.

Edited by Christian López Espínola

Merge request reports

Loading