-
Notifications
You must be signed in to change notification settings - Fork 114
test(controllers): Add missing methods for controllers #2093
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Introduces comprehensive kitchen sink apps and Playwright tests for both download_button and download_link Shiny components.
Introduces a type annotation for the filter_items variable in the OutputDataFrame class to improve code clarity and type checking.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds comprehensive testing infrastructure for Shiny controllers by implementing Playwright tests for output components and download functionality. The changes enhance the testing coverage for OutputTextVerbatim
, OutputCode
, and download components (DownloadLink
and DownloadButton
), while also adding advanced multi-column filtering support for OutputDataFrame
.
- Add Playwright tests for
OutputTextVerbatim
andOutputCode
controllers with placeholder and value expectations - Implement comprehensive test suites for
DownloadLink
andDownloadButton
with kitchen sink applications - Enhance
OutputDataFrame.set_filter()
to support multi-column filters, tuples, and advanced filtering patterns - Refactor download controllers to use a shared
_DownloadMixin
for code reuse
Reviewed Changes
Copilot reviewed 14 out of 14 changed files in this pull request and generated 3 comments.
Show a summary per file
File | Description |
---|---|
tests/playwright/shiny/outputs/test_output_text_verbatim.py |
New Playwright test for OutputTextVerbatim controller |
tests/playwright/shiny/outputs/test_output_code.py |
New Playwright test for OutputCode controller with placeholder testing |
tests/playwright/shiny/components/nav/navset_bar_kitchensink/app.py |
Refactored navset_bar application with improved structure |
tests/playwright/shiny/components/download_link/test_download_link_kitchensink.py |
Comprehensive test suite for DownloadLink controller |
tests/playwright/shiny/components/download_link/app.py |
Kitchen sink application for testing download links |
tests/playwright/shiny/components/download_button/test_download_button_kitchensink.py |
Comprehensive test suite for DownloadButton controller |
tests/playwright/shiny/components/download_button/app.py |
Kitchen sink application for testing download buttons |
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py |
Extended tests for advanced OutputDataFrame filtering capabilities |
shiny/ui/_output.py |
Updated output_code documentation from @no_example to @add_example |
shiny/playwright/controller/_output.py |
Enhanced OutputDataFrame.set_filter() with multi-column support |
shiny/playwright/controller/_file.py |
Refactored download controllers using shared _DownloadMixin |
shiny/api-examples/output_code/app-express.py |
New example application for output_code in express API |
shiny/api-examples/output_code/app-core.py |
New example application for output_code in core API |
CHANGELOG.md |
Documentation of multi-column filter support |
Comments suppressed due to low confidence (2)
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py:1
- [nitpick] String concatenation with space-separated literals should be combined into single strings for better readability.
from playwright.sync_api import Page, expect
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py:1
- [nitpick] String concatenation with space-separated literals should be combined into single strings for better readability.
from playwright.sync_api import Page, expect
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py
Outdated
Show resolved
Hide resolved
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py
Show resolved
Hide resolved
tests/playwright/shiny/components/data_frame/filter_reset/test_filter_reset.py
Outdated
Show resolved
Hide resolved
Added changelog entries for OutputDataFrame improvements and bug fixes.
Updated the import of ListOrTuple to use a relative path, ensuring compatibility with the current package structure.
The most significant changes include
OutputDataFrame.set_filter()
controller now supports advanced multi-column filters, allowing users to specify filters for multiple columns at once, including mapping values to columns and supporting tuples/lists for range and multi-column filtering.DownloadLink
andDownloadButton
controllers to use a shared_DownloadMixin
, reducing code duplication and ensuring consistent behavior for download controls.output_code
by replacing the@no_example
decorator with@add_example
and providing new example applications for both the core and express APIs.CHANGELOG.md
to document the new multi-column filter support in theOutputDataFrame.set_filter()
controller.OutputTextVerbatim
controllers#1281