Conversation
Collaborator
🪼 branch checks and previews
Install Gradio from this PR pip install https://gradio-pypi-previews.s3.amazonaws.com/ab36d83fdcfff8011691c8df0726ac84d5f2aa10/gradio-6.9.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@ab36d83fdcfff8011691c8df0726ac84d5f2aa10#subdirectory=client/python"Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/ab36d83fdcfff8011691c8df0726ac84d5f2aa10/gradio-client-2.1.0.tgz |
Collaborator
🦄 change detectedThis Pull Request includes changes to the following packages.
|
freddyaboulton
approved these changes
Mar 17, 2026
Collaborator
freddyaboulton
left a comment
There was a problem hiding this comment.
Looks great @pngwn ! Love the new mock API. I think this sets us up really nicely to convert lots of the e2e tests with unit tests.
pngwn
commented
Mar 17, 2026
Member
Author
|
I think I addressed everything now @freddyaboulton. Obviously ci doing its thing |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This is a follow-up to the recent browser testing changes focusing on testing component events.
It adds/ modifies a couple of utilities to ensure we can easily and reliably test component events. As we changed how events are fired from components in 6.0 we needed to change the utilities we use to fire them as well. We now have:
listen("event_name") -> Mocklistens for a component event and returns a mock that we can assert on:
set_data(data) -> Promise<void>in v6 we also changed how we update the data inside components. This help sets the data of a component and returns a promise that has resolved when the data has been propagated through the sveltey system (in theory, may have limits).
Exmaple:
In addition to the utilities I created a series of event test for the
Textboxcomponent to show how we use them and what a decent set of tests might look like.Feedback very welcome!
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.