Skip to content

Commit a30b8c8

Browse files
committed
Small tweaks to tests
1 parent 2ade16e commit a30b8c8

File tree

2 files changed

+10
-5
lines changed

2 files changed

+10
-5
lines changed

tests/playwright/shiny/session/clientdata/app.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,10 @@
1010

1111
@render.code
1212
def clientdatatext():
13-
cdata = session.clientdata
14-
return "\n".join([f"{name} = {cdata[name]()}" for name in reversed(dir(cdata))])
13+
client_data = session.clientdata
14+
return "\n".join(
15+
[f"{name} = {client_data[name]()}" for name in reversed(dir(client_data))]
16+
)
1517

1618

1719
@render.plot

tests/playwright/shiny/session/clientdata/test_clientdata.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,12 @@ def test_output_image_kitchen(page: Page, local_app: ShinyAppProc) -> None:
1212

1313
text = controller.OutputTextVerbatim(page, "clientdatatext")
1414

15-
# This doesn't cover all the clientdata values since some of them
16-
# are environment-dependent. However, this at least checks that the
17-
# clientdata object is available and that some values are present.
15+
# This doesn't cover all the clientdata values since we already have
16+
# tests that cover the frontend logic
17+
# https://github.com/rstudio/shinycoreci/blob/main/inst/apps/032-client-data-and-query-string/
18+
#
19+
# The important part is that we're testing here is that at least
20+
# some of these values are available in Python via session.clientdata
1821
text.expect.to_contain_text("url_protocol = http")
1922
text.expect.to_contain_text("url_pathname = /")
2023
text.expect.to_contain_text(

0 commit comments

Comments
 (0)