Skip to content

Commit 777f843

Browse files
authored
Merge 7a8e0d7 into 5b5a536
2 parents 5b5a536 + 7a8e0d7 commit 777f843

19 files changed

+664
-703
lines changed

R/tm_g_bivariate.R

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -560,12 +560,8 @@ srv_g_bivariate <- function(id,
560560
teal.reporter::teal_card("## Module's output(s)")
561561
)
562562
obj %>%
563-
teal.code::eval_code(
564-
c(
565-
'library("ggplot2");library("dplyr")', # nolint: quotes
566-
as.expression(anl_merged_input()$expr)
567-
)
568-
)
563+
teal.code::eval_code('library("ggplot2");library("dplyr")') %>%
564+
teal.code::eval_code(as.expression(anl_merged_input()$expr)) # don't mix char with expr in single eval_code
569565
})
570566

571567
merged <- list(

R/tm_g_distribution.R

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -96,10 +96,6 @@
9696
#' })
9797
#' join_keys(data) <- default_cdisc_join_keys[names(data)]
9898
#'
99-
#' vars1 <- choices_selected(
100-
#' variable_choices(data[["ADSL"]], c("ARM", "COUNTRY", "SEX")),
101-
#' selected = NULL
102-
#' )
10399
#'
104100
#' app <- init(
105101
#' data = data,
@@ -108,7 +104,7 @@
108104
#' dist_var = data_extract_spec(
109105
#' dataname = "ADSL",
110106
#' select = select_spec(
111-
#' choices = variable_choices(data[["ADSL"]], c("AGE", "BMRKR1")),
107+
#' choices = variable_choices("ADSL", c("AGE", "BMRKR1")),
112108
#' selected = "BMRKR1",
113109
#' multiple = FALSE,
114110
#' fixed = FALSE
@@ -117,14 +113,20 @@
117113
#' strata_var = data_extract_spec(
118114
#' dataname = "ADSL",
119115
#' filter = filter_spec(
120-
#' vars = vars1,
116+
#' vars = choices_selected(
117+
#' variable_choices("ADSL", c("ARM", "COUNTRY", "SEX")),
118+
#' selected = NULL
119+
#' ),
121120
#' multiple = TRUE
122121
#' )
123122
#' ),
124123
#' group_var = data_extract_spec(
125124
#' dataname = "ADSL",
126125
#' filter = filter_spec(
127-
#' vars = vars1,
126+
#' vars = choices_selected(
127+
#' variable_choices("ADSL", c("ARM", "COUNTRY", "SEX")),
128+
#' selected = "ARM"
129+
#' ),
128130
#' multiple = TRUE
129131
#' )
130132
#' )

man/tm_g_distribution.Rd

Lines changed: 11 additions & 9 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/test-examples.R

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,9 @@ for (i in rd_files()) {
141141
paste0("example-", basename(i)),
142142
{
143143
testthat::skip_on_cran()
144-
testthat::skip("chromium")
144+
if (grepl("tm_g_distribution", basename(i))) {
145+
testthat::skip("distribution initializes with short validation error")
146+
}
145147
skip_if_too_deep(5)
146148
testthat::skip_if_not_installed("pkgload")
147149
# Allow for specific validation errors for individual examples

tests/testthat/test-shinytest2-tm_a_pca.R

Lines changed: 36 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -7,32 +7,33 @@ app_driver_tm_a_pca <- function() {
77
})
88

99
init_teal_app_driver(
10-
data = data,
11-
modules = tm_a_pca(
12-
dat = teal.transform::data_extract_spec(
13-
dataname = "USArrests",
14-
select = teal.transform::select_spec(
15-
choices = teal.transform::variable_choices(
16-
data = data[["USArrests"]],
17-
c("Murder", "Assault", "UrbanPop", "Rape")
18-
),
19-
selected = c("Murder", "Assault"),
20-
multiple = TRUE
21-
)
22-
),
23-
size = c(3, 1, 5),
24-
alpha = c(.5, 0, 1),
25-
font_size = c(10, 8, 15),
26-
ggtheme = "light",
27-
rotate_xaxis_labels = TRUE,
28-
pre_output = shiny::tags$div(id = "unique_id_pre", "A pre output"),
29-
post_output = shiny::tags$div(id = "unique_id_post", "A post output")
10+
teal::init(
11+
data = data,
12+
modules = tm_a_pca(
13+
dat = teal.transform::data_extract_spec(
14+
dataname = "USArrests",
15+
select = teal.transform::select_spec(
16+
choices = teal.transform::variable_choices(
17+
data = data[["USArrests"]],
18+
c("Murder", "Assault", "UrbanPop", "Rape")
19+
),
20+
selected = c("Murder", "Assault"),
21+
multiple = TRUE
22+
)
23+
),
24+
size = c(3, 1, 5),
25+
alpha = c(.5, 0, 1),
26+
font_size = c(10, 8, 15),
27+
ggtheme = "light",
28+
rotate_xaxis_labels = TRUE,
29+
pre_output = shiny::tags$div(id = "unique_id_pre", "A pre output"),
30+
post_output = shiny::tags$div(id = "unique_id_post", "A post output")
31+
)
3032
)
3133
)
3234
}
3335

3436
testthat::test_that("e2e - tm_a_pca: Module is initialised with the specified defaults in function call.", {
35-
testthat::skip("chromium")
3637
skip_if_too_deep(5)
3738

3839
app_driver <- app_driver_tm_a_pca()
@@ -44,9 +45,14 @@ testthat::test_that("e2e - tm_a_pca: Module is initialised with the specified de
4445
c("Murder", "Assault")
4546
)
4647

47-
module_parent_id <- gsub("-module$", "", app_driver$active_module_ns())
48-
testthat::expect_equal(app_driver$get_text(sprintf("#%s %s", module_parent_id, "#unique_id_pre")), "A pre output")
49-
testthat::expect_equal(app_driver$get_text(sprintf("#%s %s", module_parent_id, "#unique_id_post")), "A post output")
48+
testthat::expect_equal(
49+
app_driver$get_text("#unique_id_pre"),
50+
"A pre output"
51+
)
52+
testthat::expect_equal(
53+
app_driver$get_text("#unique_id_post"),
54+
"A post output"
55+
)
5056

5157
# Plot options that can be changed in call
5258
testthat::expect_true(app_driver$get_active_module_input("rotate_xaxis_labels"))
@@ -57,7 +63,6 @@ testthat::test_that("e2e - tm_a_pca: Module is initialised with the specified de
5763
})
5864

5965
testthat::test_that("e2e - tm_a_pca: Eigenvector table should have data extract selection Murder/Assault on header.", {
60-
testthat::skip("chromium")
6166
skip_if_too_deep(5)
6267

6368
app_driver <- app_driver_tm_a_pca()
@@ -75,7 +80,6 @@ testthat::test_that("e2e - tm_a_pca: Eigenvector table should have data extract
7580
})
7681

7782
testthat::test_that("e2e - tm_a_pca: Eigenvector table should have data extract selection Murder/UrbanPop on header.", {
78-
testthat::skip("chromium")
7983
skip_if_too_deep(5)
8084

8185
app_driver <- app_driver_tm_a_pca()
@@ -93,7 +97,6 @@ testthat::test_that("e2e - tm_a_pca: Eigenvector table should have data extract
9397
})
9498

9599
testthat::test_that("e2e - tm_a_pca: Color by columns (data_extract) must be from non-selected variable set.", {
96-
testthat::skip("chromium")
97100
skip_if_too_deep(5)
98101

99102
app_driver <- app_driver_tm_a_pca()
@@ -111,7 +114,6 @@ testthat::test_that("e2e - tm_a_pca: Color by columns (data_extract) must be fro
111114
})
112115

113116
testthat::test_that("e2e - tm_a_pca: Changing output encodings of tables_display does not generate errors.", {
114-
testthat::skip("chromium")
115117
skip_if_too_deep(5)
116118

117119
app_driver <- app_driver_tm_a_pca()
@@ -133,7 +135,6 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings of tables_display
133135
})
134136

135137
testthat::test_that("e2e - tm_a_pca: Changing output encodings for 'plot type' does not generate errors.", {
136-
testthat::skip("chromium")
137138
skip_if_too_deep(5)
138139

139140
app_driver <- app_driver_tm_a_pca()
@@ -157,7 +158,6 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings for 'plot type' d
157158
})
158159

159160
testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'standardization' does not generate errors.", {
160-
testthat::skip("chromium")
161161
skip_if_too_deep(5)
162162

163163
app_driver <- app_driver_tm_a_pca()
@@ -176,7 +176,6 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'standardizati
176176
})
177177

178178
testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'NA action' does not generate errors.", {
179-
testthat::skip("chromium")
180179
skip_if_too_deep(5)
181180

182181
app_driver <- app_driver_tm_a_pca()
@@ -191,31 +190,26 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'NA action' do
191190
})
192191

193192
testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'plot_type' hides and shows options.", {
194-
testthat::skip("chromium")
195193
skip_if_too_deep(5)
196194

197195
app_driver <- app_driver_tm_a_pca()
198196
app_driver$expect_no_validation_error()
199197

200198
# Selected plot's specific settings is not visible
201-
no_plot_settings_selector <- sprintf("#%s-%s %s", app_driver$active_module_ns(), "plot_settings", "span.help-block")
202-
x_axis_selector <- sprintf("#%s-%s", app_driver$active_module_ns(), "x_axis")
203-
color_by_selector <- sprintf(
204-
"#%s-%s",
205-
app_driver$active_module_ns(),
206-
"response-dataset_USArrests_singleextract-select_input"
207-
)
199+
no_plot_settings_selector <- app_driver$namespaces(TRUE)$module("plot_settings span.help-block")
200+
x_axis_selector <- app_driver$namespaces(TRUE)$module("x_axis")
201+
color_by_selector <- app_driver$namespaces(TRUE)$module("response-dataset_USArrests_singleextract-select_input")
208202

209-
app_driver$set_active_module_input("plot_type", "Elbow plot", wait = FALSE)
203+
app_driver$set_active_module_input("plot_type", "Elbow plot", wait_ = FALSE)
210204
testthat::expect_true(app_driver$is_visible(no_plot_settings_selector))
211205
testthat::expect_false(app_driver$is_visible(x_axis_selector))
212206
testthat::expect_false(app_driver$is_visible(color_by_selector))
213207

214-
app_driver$set_active_module_input("plot_type", "Circle plot", wait = FALSE)
208+
app_driver$set_active_module_input("plot_type", "Circle plot", wait_ = FALSE)
215209
testthat::expect_false(app_driver$is_visible(no_plot_settings_selector))
216210
testthat::expect_true(app_driver$is_visible(x_axis_selector))
217211

218-
app_driver$set_active_module_input("plot_type", "Biplot", wait = FALSE)
212+
app_driver$set_active_module_input("plot_type", "Biplot", wait_ = FALSE)
219213
testthat::expect_false(app_driver$is_visible(no_plot_settings_selector))
220214
testthat::expect_true(app_driver$is_visible(x_axis_selector))
221215
testthat::expect_true(app_driver$is_visible(color_by_selector))
@@ -224,7 +218,6 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'plot_type' hi
224218
})
225219

226220
testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'theme' does not generate errors.", {
227-
testthat::skip("chromium")
228221
skip_if_too_deep(5)
229222

230223
app_driver <- app_driver_tm_a_pca()
@@ -243,7 +236,6 @@ testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'theme' does n
243236
})
244237

245238
testthat::test_that("e2e - tm_a_pca: Changing output encodings of 'font size' does not generate errors.", {
246-
testthat::skip("chromium")
247239
skip_if_too_deep(5)
248240

249241
app_driver <- app_driver_tm_a_pca()

0 commit comments

Comments
 (0)