Skip to content
Merged
5 changes: 3 additions & 2 deletions tests/testthat/test-shinytest2-tm_t_events.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ testthat::test_that(
app_driver <- app_driver_tm_t_events()

testthat::expect_equal(
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
app_driver$get_text("a.nav-link.active"),
"Adverse Event Table"
)
testthat::expect_equal(
Expand Down Expand Up @@ -116,8 +116,9 @@ testthat::test_that("e2e - tm_t_events: Deselection of arm_var throws validation
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
app_driver$expect_validation_error()
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
testthat::expect_equal(
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
"Please select 1 or 2 treatment variable values"
)
app_driver$stop()
Expand Down
8 changes: 5 additions & 3 deletions tests/testthat/test-shinytest2-tm_t_events_by_grade.R
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ testthat::test_that(
skip_if_too_deep(5)
app_driver <- app_driver_tm_t_events_by_grade()
testthat::expect_equal(
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
app_driver$get_text("a.nav-link.active"),
"Adverse Events by Grade Table"
)
testthat::expect_equal(
Expand Down Expand Up @@ -129,8 +129,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of arm_var throws v
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
app_driver$expect_validation_error()
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
testthat::expect_equal(
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
"A treatment variable is required"
)
app_driver$stop()
Expand Down Expand Up @@ -232,8 +233,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of grade throws val
app_driver$set_active_module_input("grade-dataset_ADAE_singleextract-select", NULL)
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
app_driver$expect_validation_error()
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
testthat::expect_equal(
app_driver$get_text(app_driver$namespaces(TRUE)$module("grade-dataset_ADAE_singleextract-select_input .shiny-validation-message")),
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
"An event grade is required"
)
app_driver$stop()
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-shinytest2-tm_t_events_patyear.R
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ testthat::test_that(
skip_if_too_deep(5)
app_driver <- app_driver_tm_t_events_patyear()
testthat::expect_equal(
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
app_driver$get_text("a.nav-link.active"),
"AE Rate Adjusted for Patient-Years At Risk Table"
)
testthat::expect_equal(
Expand Down Expand Up @@ -168,8 +168,9 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of arm_var throws va
data.frame()
)
app_driver$expect_validation_error()
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
testthat::expect_equal(
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
"Please select exactly 1 or 2 treatment variables"
)
app_driver$stop()
Expand Down
5 changes: 3 additions & 2 deletions tests/testthat/test-shinytest2-tm_t_events_summary.R
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ testthat::test_that(
skip_if_too_deep(5)
app_driver <- app_driver_tm_t_events_summary()
testthat::expect_equal(
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
app_driver$get_text("a.nav-link.active"),
"Adverse Events Summary"
)
testthat::expect_equal(
Expand Down Expand Up @@ -158,8 +158,9 @@ testthat::test_that("e2e - tm_t_events_summary: Deselection of arm_var throws va
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
app_driver$expect_validation_error()
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
testthat::expect_equal(
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
"Please select exactly 1 or 2 treatment variables"
)
app_driver$stop()
Expand Down
Loading