From 19f86c3b09ed1be3bd13f3ece214608273cb1c3c Mon Sep 17 00:00:00 2001 From: osenan Date: Wed, 26 Nov 2025 17:03:46 -0300 Subject: [PATCH 1/3] fix: change to more general selector as there is no id in the module --- tests/testthat/test-shinytest2-tm_t_binary_outcome.R | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R index c3e2e1fd7..7633cc0a6 100644 --- a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R +++ b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R @@ -221,11 +221,17 @@ testthat::test_that( testthat::test_that("e2e - tm_t_binary_outcome: Deselection of responders throws validation error.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() + testthat::expect_false( + identical( + app_driver$get_text(".shiny-validation-message"), + "`Responders` field is empty" + ) + ) app_driver$set_active_module_input("responders", NULL) testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$get_text(app_driver$namespaces(TRUE)$module("responders_input .shiny-validation-message")), + app_driver$get_text(".shiny-validation-message"), # it works because is the only validation message present "`Responders` field is empty" ) app_driver$stop() From 589331819970f9ab57d9204dc013c3e83803ac0a Mon Sep 17 00:00:00 2001 From: osenan Date: Wed, 26 Nov 2025 23:02:51 -0300 Subject: [PATCH 2/3] fix: add children table tag to selector in order to check the current table and not the div element --- tests/testthat/test-shinytest2-tm_g_barchart_simple.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-shinytest2-tm_g_barchart_simple.R b/tests/testthat/test-shinytest2-tm_g_barchart_simple.R index 36aa40f94..453e75a64 100644 --- a/tests/testthat/test-shinytest2-tm_g_barchart_simple.R +++ b/tests/testthat/test-shinytest2-tm_g_barchart_simple.R @@ -127,7 +127,7 @@ testthat::test_that("e2e - tm_g_barchart_simple: Module initializes in teal with # Table is rendered asynchronously, wait a bit more app_driver$wait_for_idle() - testthat::expect_true(app_driver$is_visible(app_driver$namespaces(TRUE)$module("table"))) + testthat::expect_true(app_driver$is_visible(app_driver$namespaces(TRUE)$module("table > table"))) app_driver$stop() }) From 1e0e693415bad2474cee9903089a36593064e4fa Mon Sep 17 00:00:00 2001 From: Oriol Senan <35930244+osenan@users.noreply.github.com> Date: Thu, 27 Nov 2025 10:45:41 -0300 Subject: [PATCH 3/3] Update tests/testthat/test-shinytest2-tm_t_binary_outcome.R Remove unnecessary comment Co-authored-by: Marcin <133694481+m7pr@users.noreply.github.com> Signed-off-by: Oriol Senan <35930244+osenan@users.noreply.github.com> --- tests/testthat/test-shinytest2-tm_t_binary_outcome.R | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R index 7633cc0a6..0c5c4ad80 100644 --- a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R +++ b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R @@ -231,7 +231,7 @@ testthat::test_that("e2e - tm_t_binary_outcome: Deselection of responders throws testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame()) app_driver$expect_validation_error() testthat::expect_equal( - app_driver$get_text(".shiny-validation-message"), # it works because is the only validation message present + app_driver$get_text(".shiny-validation-message"), "`Responders` field is empty" ) app_driver$stop()