Skip to content

Audio and Video unit tests#13167

Open
freddyaboulton wants to merge 4 commits intomainfrom
13059-audio-unit-tests
Open

Audio and Video unit tests#13167
freddyaboulton wants to merge 4 commits intomainfrom
13059-audio-unit-tests

Conversation

@freddyaboulton
Copy link
Copy Markdown
Collaborator

Description

Closes: #13059
Closes: #13111

  • Same code change to audio and video components as image component in (Use test utils for Image unit tests #13165).
  • The audio component relies heavily on wavesurfer. So I mocked the wavesurfer import in beforeEach. This mock also creates a mock element with a shadowdom to be able to test the audio trimming
  • Both files cover the file upload, clearing, interactive vs non-interactive, data get and set patterns

AI Disclosure

We encourage the use of AI tooling in creating PRs, but the any non-trivial use of AI needs be disclosed. E.g. if you used Claude to write a first draft, you should mention that. Trivial tab-completion doesn't need to be disclosed. You should self-review all PRs, especially if they were generated with AI.

  • I used AI to... [fill here]
  • I did not use AI

🎯 PRs Should Target Issues

Before your create a PR, please check to see if there is an existing issue for this change. If not, please create an issue before you create this PR, unless the fix is very small.

Not adhering to this guideline will result in the PR being closed.

Testing and Formatting Your Code

  1. PRs will only be merged if tests pass on CI. We recommend at least running the backend tests locally, please set up your Gradio environment locally and run the backed tests: bash scripts/run_backend_tests.sh

  2. Please run these bash scripts to automatically format your code: bash scripts/format_backend.sh, and (if you made any changes to non-Python files) bash scripts/format_frontend.sh

@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Mar 30, 2026

🪼 branch checks and previews

Name Status URL
Spaces building...
Storybook ready! Storybook preview
🦄 Changes detected! Details

@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Mar 30, 2026

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@gradio/audio patch
@gradio/video patch
gradio patch

  • Audio and Video unit tests

‼️ Changeset not approved. Ensure the version bump is appropriate for all packages before approving.

  • Maintainers can approve the changeset by checking this checkbox.

Something isn't right?

  • Maintainers can change the version label to modify the version bump.
  • If the bot has failed to detect any changes, or if this pull request needs to update multiple packages to different versions or requires a more comprehensive changelog entry, maintainers can update the changelog file directly.

@freddyaboulton freddyaboulton marked this pull request as ready for review March 30, 2026 21:42
@freddyaboulton freddyaboulton added the v: patch A change that requires a patch release label Mar 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v: patch A change that requires a patch release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

video: refactor unit tests audio: refactor unit tests

2 participants