Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* `shiny create` includes new and improved `ui.Chat()` template options. Most of these templates leverage the new [`{chatlas}` package](https://posit-dev.github.io/chatlas/), our opinionated approach to interfacing with various LLM. (#1806)

* Added a new `expect_max_height()` method to the Valuebox controllers to check the maximum height of a value box (#1816)

* Client data values (e.g., url info, output sizes/styles, etc.) can now be accessed in the server-side Python code via `session.clientdata`. For example, `session.clientdata.url_search()` reactively reads the URL search parameters. (#1832)

* Available `input` ids can now be listed via `dir(input)`. This also works on the new `session.clientdata` object. (#1832)
Expand All @@ -37,6 +39,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

* `ui.Chat()` now correctly handles new `ollama.chat()` return value introduced in `ollama` v0.4. (#1787)

* Updated `expect_height()` for Valuebox controllers to check the height property instead of max-height. (#1816)

### Changes

* The Shiny Core component `shiny.ui.Chat()` no longer has a `.ui()` method. This method
Expand Down
15 changes: 15 additions & 0 deletions shiny/playwright/controller/_card.py
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,21 @@ def expect_height(self, value: StyleValue, *, timeout: Timeout = None) -> None:
timeout
The maximum time to wait for the expectation to pass. Defaults to `None`.
"""
_expect_style_to_have_value(
self.loc_container, "height", value, timeout=timeout
)

def expect_max_height(self, value: StyleValue, *, timeout: Timeout = None) -> None:
"""
Expects the value box to have a specific maximum height.

Parameters
----------
value
The expected maximum height value.
timeout
The maximum time to wait for the expectation to pass. Defaults to `None`.
"""
_expect_style_to_have_value(
self.loc_container, "max-height", value, timeout=timeout
)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ def test_valuebox(page: Page, local_app: ShinyAppProc) -> None:
assert get_value_box_bg_color(value_box4) == "rgb(255, 255, 255)"

value_box5 = controller.ValueBox(page, "valuebox5")
value_box5.expect_height("500px")
value_box5.expect_max_height("500px")
assert get_title_tag_name(value_box5) == "p"
value_box5.expect_title("No showcase w/ showcase layout")
value_box5.expect_value("Red text - fill is False")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,8 @@ def test_valuebox(page: Page, local_app: ShinyAppProc, value_box_id: str) -> Non
value_box.expect_value("$1 Billion Dollars")
value_box.expect_body(["30% VS PREVIOUS 30 DAYS"])
else:
value_box.expect_height("500px")
value_box.expect_max_height("500px")
value_box.expect_height("300px")
value_box.expect_title("title")
value_box.expect_value("value")
value_box.expect_body(["content", "more body"])
Expand Down
Loading