Conversation
🪼 branch checks and previews
Install Gradio from this PR pip install https://huggingface.co/buckets/gradio/pypi-previews/resolve/3dea27aadd6c94c137583392ec9407fc4590c952/gradio-6.11.0-py3-none-any.whlInstall Gradio Python Client from this PR pip install "gradio-client @ git+https://github.com/gradio-app/gradio@3dea27aadd6c94c137583392ec9407fc4590c952#subdirectory=client/python"Install Gradio JS Client from this PR npm install https://gradio-npm-previews.s3.amazonaws.com/3dea27aadd6c94c137583392ec9407fc4590c952/gradio-client-2.1.0.tgz |
🦄 change detectedThis Pull Request includes changes to the following packages.
✅ Changeset approved by @freddyaboulton
|
pngwn
left a comment
There was a problem hiding this comment.
Look great @freddyaboulton. But we are doing a lot of truthy checks on elements. I'd rather we asserted on exactly what we expect. Are they visible, hidden, not rendered etc.
There are more appropriate expect methods for that:
toBeInTheDocument()/not.toBeInTheDocument()toBeInTheViewport()/not.toBeInTheViewport()toBeVisible()/not.toBeVisible()
I think i'll need to modify the skill a bit.
js/gallery/Gallery.test.ts
Outdated
| }); | ||
|
|
||
| // Gallery uses {#if show_label} — label is completely removed, not just hidden | ||
| expect(queryByText("My Gallery")).toBeNull(); |
There was a problem hiding this comment.
I think not.toBeInTheDocument() works for this case, unless i've just made it up.
js/gallery/Gallery.test.ts
Outdated
| expect(getByRole("button", { name: "Thumbnail 1 of 3" })).toBeTruthy(); | ||
| expect(getByRole("button", { name: "Thumbnail 2 of 3" })).toBeTruthy(); | ||
| expect(getByRole("button", { name: "Thumbnail 3 of 3" })).toBeTruthy(); | ||
| }); |
js/gallery/Gallery.test.ts
Outdated
| expect(getByRole("button", { name: "Thumbnail 1 of 2" })).toBeTruthy(); | ||
| expect(getByRole("button", { name: "Thumbnail 2 of 2" })).toBeTruthy(); |
js/gallery/Gallery.test.ts
Outdated
| show_label: true, | ||
| label: "Gallery", | ||
| loading_status: loading_status, | ||
| // ─── Props: selected_index ─────────────────────────────────────────── |
There was a problem hiding this comment.
Can we get rid of these redundant comments pls, they are just duplicating the describe block.
|
On it @pngwn ! Thank you |
|
I think I've addressed all the comments @pngwn ! |
pngwn
left a comment
There was a problem hiding this comment.
Looks great. Thanks @freddyaboulton!
|
Thanks for the review @pngwn ! |
Description
Closes: #13080
Closes: #13217
Fixed two issues as well:
on_custom_button_clickgot renamed tocustom_button_clickAI 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.
🎯 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
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.shPlease 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