Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
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