Skip to content

Button Unit Tests#13192

Merged
freddyaboulton merged 11 commits intomainfrom
button-tests
Apr 9, 2026
Merged

Button Unit Tests#13192
freddyaboulton merged 11 commits intomainfrom
button-tests

Conversation

@dawoodkhan82
Copy link
Copy Markdown
Collaborator

@dawoodkhan82 dawoodkhan82 commented Apr 3, 2026

Description

Unit tests for button

Closes: #13062

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 Apr 3, 2026

🪼 branch checks and previews

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

Install Gradio from this PR

pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/64d04efc39d88675583961e8d8c12e8da401d739/gradio-6.11.0-py3-none-any.whl

Install Gradio Python Client from this PR

pip install "gradio-client @ git+https://github.com/gradio-app/gradio@64d04efc39d88675583961e8d8c12e8da401d739#subdirectory=client/python"

Install Gradio JS Client from this PR

npm install https://gradio-npm-previews.s3.amazonaws.com/64d04efc39d88675583961e8d8c12e8da401d739/gradio-client-2.1.0.tgz

@gradio-pr-bot
Copy link
Copy Markdown
Collaborator

gradio-pr-bot commented Apr 3, 2026

🦄 change detected

This Pull Request includes changes to the following packages.

Package Version
@self/tootils minor

  • Button Unit Tests

✅ Changeset approved by @freddyaboulton

  • Maintainers can remove approval by unchecking 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.

@dawoodkhan82 dawoodkhan82 marked this pull request as ready for review April 3, 2026 19:21
Copy link
Copy Markdown
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We need to replace the query selectors with something more semantic, use the shared tests cover utils and assert on behaviour rather than implementation (ie check the functionality is correct rather than checking for attributes).

Some of these should be visual tests as well, as they are not functionally testable.

Copy link
Copy Markdown

@christama christama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review

@pngwn
Copy link
Copy Markdown
Member

pngwn commented Apr 8, 2026

Thank you @christama, this was very insightful.

Copy link
Copy Markdown
Member

@pngwn pngwn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good. Thanks @dawoodkhan82!

@freddyaboulton
Copy link
Copy Markdown
Collaborator

Thanks @dawoodkhan82 ! Gonna merge to clear the pr queue

@freddyaboulton freddyaboulton merged commit f4656ae into main Apr 9, 2026
24 of 25 checks passed
@freddyaboulton freddyaboulton deleted the button-tests branch April 9, 2026 19:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

button: refactor unit tests

5 participants