Skip to content

Commit b12dbde

Browse files
committed
Merge branch 'bring_tests' of https://github.com/insightsengineering/teal.modules.clinical into bring_tests
2 parents d5f1082 + 4d003c2 commit b12dbde

6 files changed

+20
-13
lines changed

tests/testthat/test-shinytest2-tm_t_events.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ testthat::test_that(
5959
app_driver <- app_driver_tm_t_events()
6060

6161
testthat::expect_equal(
62-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
62+
app_driver$get_text("a.nav-link.active"),
6363
"Adverse Event Table"
6464
)
6565
testthat::expect_equal(
@@ -116,8 +116,9 @@ testthat::test_that("e2e - tm_t_events: Deselection of arm_var throws validation
116116
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
117117
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
118118
app_driver$expect_validation_error()
119+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
119120
testthat::expect_equal(
120-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
121+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
121122
"Please select 1 or 2 treatment variable values"
122123
)
123124
app_driver$stop()

tests/testthat/test-shinytest2-tm_t_events_by_grade.R

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ testthat::test_that(
7171
skip_if_too_deep(5)
7272
app_driver <- app_driver_tm_t_events_by_grade()
7373
testthat::expect_equal(
74-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
74+
app_driver$get_text("a.nav-link.active"),
7575
"Adverse Events by Grade Table"
7676
)
7777
testthat::expect_equal(
@@ -129,8 +129,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of arm_var throws v
129129
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
130130
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
131131
app_driver$expect_validation_error()
132+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
132133
testthat::expect_equal(
133-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
134+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
134135
"A treatment variable is required"
135136
)
136137
app_driver$stop()
@@ -232,8 +233,9 @@ testthat::test_that("e2e - tm_t_events_by_grade: Deselection of grade throws val
232233
app_driver$set_active_module_input("grade-dataset_ADAE_singleextract-select", NULL)
233234
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
234235
app_driver$expect_validation_error()
236+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
235237
testthat::expect_equal(
236-
app_driver$get_text(app_driver$namespaces(TRUE)$module("grade-dataset_ADAE_singleextract-select_input .shiny-validation-message")),
238+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
237239
"An event grade is required"
238240
)
239241
app_driver$stop()

tests/testthat/test-shinytest2-tm_t_events_patyear.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ testthat::test_that(
7272
skip_if_too_deep(5)
7373
app_driver <- app_driver_tm_t_events_patyear()
7474
testthat::expect_equal(
75-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
75+
app_driver$get_text("a.nav-link.active"),
7676
"AE Rate Adjusted for Patient-Years At Risk Table"
7777
)
7878
testthat::expect_equal(
@@ -168,8 +168,9 @@ testthat::test_that("e2e - tm_t_events_patyear: Deselection of arm_var throws va
168168
data.frame()
169169
)
170170
app_driver$expect_validation_error()
171+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
171172
testthat::expect_equal(
172-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
173+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
173174
"Please select exactly 1 or 2 treatment variables"
174175
)
175176
app_driver$stop()

tests/testthat/test-shinytest2-tm_t_events_summary.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -111,7 +111,7 @@ testthat::test_that(
111111
skip_if_too_deep(5)
112112
app_driver <- app_driver_tm_t_events_summary()
113113
testthat::expect_equal(
114-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
114+
app_driver$get_text("a.nav-link.active"),
115115
"Adverse Events Summary"
116116
)
117117
testthat::expect_equal(
@@ -158,8 +158,9 @@ testthat::test_that("e2e - tm_t_events_summary: Deselection of arm_var throws va
158158
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
159159
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
160160
app_driver$expect_validation_error()
161+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
161162
testthat::expect_equal(
162-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
163+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
163164
"Please select exactly 1 or 2 treatment variables"
164165
)
165166
app_driver$stop()

tests/testthat/test-shinytest2-tm_t_summary.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ testthat::test_that("e2e - tm_t_summary: Starts with specified label, arm_var, s
5050
skip_if_too_deep(5)
5151
app_driver <- app_driver_tm_t_summary()
5252
testthat::expect_equal(
53-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
53+
app_driver$get_text("a.nav-link.active"),
5454
"Demographic Table"
5555
)
5656
testthat::expect_equal(
@@ -96,8 +96,9 @@ testthat::test_that("e2e - tm_t_summary: Deselection of arm_var throws validatio
9696
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
9797
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
9898
app_driver$expect_validation_error()
99+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
99100
testthat::expect_equal(
100-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
101+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
101102
"Please select 1 or 2 column variables"
102103
)
103104
app_driver$stop()

tests/testthat/test-shinytest2-tm_t_summary_by.R

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ testthat::test_that(
7171
skip_if_too_deep(5)
7272
app_driver <- app_driver_tm_t_summary_by()
7373
testthat::expect_equal(
74-
app_driver$get_text("#teal-teal_modules-active_tab .active > a"),
74+
app_driver$get_text("a.nav-link.active"),
7575
"Summary by Row Groups Table"
7676
)
7777
testthat::expect_equal(
@@ -130,8 +130,9 @@ testthat::test_that("e2e - tm_t_summary_by: Deselection of arm_var throws valida
130130
app_driver$set_active_module_input("arm_var-dataset_ADSL_singleextract-select", NULL)
131131
testthat::expect_identical(app_driver$get_active_module_table_output("table-table-with-settings"), data.frame())
132132
app_driver$expect_validation_error()
133+
selector <- "arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message"
133134
testthat::expect_equal(
134-
app_driver$get_text(app_driver$namespaces(TRUE)$module("arm_var-dataset_ADSL_singleextract-select_input .shiny-validation-message")),
135+
app_driver$get_text(app_driver$namespaces(TRUE)$module(selector)),
135136
"Please select 1 or 2 column variables"
136137
)
137138
app_driver$stop()

0 commit comments

Comments
 (0)