From 12c9f3c8f643cb568aaf6dc6b3d8cf5d5c994b48 Mon Sep 17 00:00:00 2001 From: vedhav Date: Tue, 23 Apr 2024 16:58:05 +0530 Subject: [PATCH 1/2] feat: initialize apps for testing --- tests/testthat/helper-TealAppDriver.R | 15 ++++ .../test-shinytest2-tm_g_forest_tte copy.R | 77 +++++++++++++++++ .../test-shinytest2-tm_g_forest_tte.R | 69 +++++++++++++++ tests/testthat/test-shinytest2-tm_g_km.R | 65 ++++++++++++++ .../testthat/test-shinytest2-tm_g_lineplot.R | 53 ++++++++++++ .../test-shinytest2-tm_g_pp_adverse_events.R | 70 +++++++++++++++ ...test-shinytest2-tm_g_pp_patient_timeline.R | 19 ++++ .../test-shinytest2-tm_g_pp_therapy.R | 86 +++++++++++++++++++ .../testthat/test-shinytest2-tm_g_pp_vitals.R | 19 ++++ .../test-shinytest2-tm_t_abnormality.R | 61 +++++++++++++ ...inytest2-tm_t_abnormality_by_worst_grade.R | 52 +++++++++++ tests/testthat/test-shinytest2-tm_t_ancova.R | 69 +++++++++++++++ .../test-shinytest2-tm_t_binary_outcome.R | 12 +++ tests/testthat/test-shinytest2-tm_t_coxreg.R | 19 ++++ tests/testthat/test-shinytest2-tm_t_events.R | 12 +++ .../test-shinytest2-tm_t_events_by_grade.R | 12 +++ .../test-shinytest2-tm_t_events_patyear.R | 12 +++ .../test-shinytest2-tm_t_events_summary.R | 12 +++ .../testthat/test-shinytest2-tm_t_exposure.R | 12 +++ .../testthat/test-shinytest2-tm_t_logistic.R | 12 +++ .../test-shinytest2-tm_t_mult_events.R | 12 +++ .../test-shinytest2-tm_t_pp_basic_info.R | 12 +++ .../test-shinytest2-tm_t_pp_laboratory.R | 12 +++ .../test-shinytest2-tm_t_pp_medical_history.R | 14 +++ ...test-shinytest2-tm_t_pp_prior_medication.R | 14 +++ .../test-shinytest2-tm_t_shift_by_arm.R | 12 +++ ...st-shinytest2-tm_t_shift_by_arm_by_worst.R | 15 ++++ .../test-shinytest2-tm_t_shift_by_grade.R | 12 +++ tests/testthat/test-shinytest2-tm_t_smq.R | 12 +++ tests/testthat/test-shinytest2-tm_t_summary.R | 12 +++ .../test-shinytest2-tm_t_summary_by.R | 12 +++ tests/testthat/test-shinytest2-tm_t_tte.R | 12 +++ 32 files changed, 909 insertions(+) create mode 100644 tests/testthat/test-shinytest2-tm_g_forest_tte copy.R create mode 100644 tests/testthat/test-shinytest2-tm_g_forest_tte.R create mode 100644 tests/testthat/test-shinytest2-tm_g_km.R create mode 100644 tests/testthat/test-shinytest2-tm_g_lineplot.R create mode 100644 tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R create mode 100644 tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R create mode 100644 tests/testthat/test-shinytest2-tm_g_pp_therapy.R create mode 100644 tests/testthat/test-shinytest2-tm_g_pp_vitals.R create mode 100644 tests/testthat/test-shinytest2-tm_t_abnormality.R create mode 100644 tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R create mode 100644 tests/testthat/test-shinytest2-tm_t_ancova.R create mode 100644 tests/testthat/test-shinytest2-tm_t_binary_outcome.R create mode 100644 tests/testthat/test-shinytest2-tm_t_coxreg.R create mode 100644 tests/testthat/test-shinytest2-tm_t_events.R create mode 100644 tests/testthat/test-shinytest2-tm_t_events_by_grade.R create mode 100644 tests/testthat/test-shinytest2-tm_t_events_patyear.R create mode 100644 tests/testthat/test-shinytest2-tm_t_events_summary.R create mode 100644 tests/testthat/test-shinytest2-tm_t_exposure.R create mode 100644 tests/testthat/test-shinytest2-tm_t_logistic.R create mode 100644 tests/testthat/test-shinytest2-tm_t_mult_events.R create mode 100644 tests/testthat/test-shinytest2-tm_t_pp_basic_info.R create mode 100644 tests/testthat/test-shinytest2-tm_t_pp_laboratory.R create mode 100644 tests/testthat/test-shinytest2-tm_t_pp_medical_history.R create mode 100644 tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R create mode 100644 tests/testthat/test-shinytest2-tm_t_shift_by_arm.R create mode 100644 tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R create mode 100644 tests/testthat/test-shinytest2-tm_t_shift_by_grade.R create mode 100644 tests/testthat/test-shinytest2-tm_t_smq.R create mode 100644 tests/testthat/test-shinytest2-tm_t_summary.R create mode 100644 tests/testthat/test-shinytest2-tm_t_summary_by.R create mode 100644 tests/testthat/test-shinytest2-tm_t_tte.R diff --git a/tests/testthat/helper-TealAppDriver.R b/tests/testthat/helper-TealAppDriver.R index b28850e396..ca20b142ee 100644 --- a/tests/testthat/helper-TealAppDriver.R +++ b/tests/testthat/helper-TealAppDriver.R @@ -23,3 +23,18 @@ init_teal_app_driver <- function(...) { .package = "teal" ) } + + +# TODO: This will be moved to the `TealAppDriver` class. +active_module_tws_output <- function(app_driver, element = "table-table-with-settings", which = 1) { + app_driver$active_module_element(element) %>% + app_driver$get_html_rvest() %>% + rvest::html_table(fill = TRUE) %>% + { + if (identical(., list())) { + . + } else { + .[[which]] + } + } +} diff --git a/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R b/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R new file mode 100644 index 0000000000..951e2b1e63 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R @@ -0,0 +1,77 @@ +app_driver_tm_g_ipp <- function() { + data <- teal_data() %>% + within({ + library(nestcolor) + library(dplyr) + ADSL <- tmc_ex_adsl %>% + slice(1:20) %>% + df_explicit_na() + ADLB <- tmc_ex_adlb %>% + filter(USUBJID %in% ADSL$USUBJID) %>% + df_explicit_na() %>% + filter(AVISIT != "SCREENING") + }) + + datanames <- c("ADSL", "ADLB") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_ipp( + label = "Individual Patient Plot", + dataname = "ADLB", + arm_var = teal.transform::choices_selected( + teal.transform::value_choices(data[["ADLB"]], "ARMCD"), + "ARM A" + ), + paramcd = teal.transform::choices_selected( + teal.transform::value_choices(data[["ADLB"]], "PARAMCD"), + "ALT" + ), + aval_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("AVAL", "CHG")), + "AVAL" + ), + avalu_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("AVALU")), + "AVALU", + fixed = TRUE + ), + id_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("USUBJID")), + "USUBJID", + fixed = TRUE + ), + visit_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("AVISIT")), + "AVISIT" + ), + baseline_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("BASE")), + "BASE", + fixed = TRUE + ), + add_baseline_hline = FALSE, + separate_by_obs = FALSE + ) + ) + ) +} + +testthat::test_that("e2e - tm_g_ipp: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_ipp() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_forest_tte.R b/tests/testthat/test-shinytest2-tm_g_forest_tte.R new file mode 100644 index 0000000000..27063b326c --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_forest_tte.R @@ -0,0 +1,69 @@ +app_driver_tm_g_forest_tte <- function() { + data <- teal.data::teal_data() %>% + within({ + library(nestcolor) + library(formatters) + + ADSL <- tmc_ex_adsl + ADTTE <- tmc_ex_adtte + ADSL$RACE <- droplevels(ADSL$RACE) %>% + with_label("Race") + }) + datanames <- c("ADSL", "ADTTE") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + arm_ref_comp <- list( + ARM = list( + ref = "B: Placebo", + comp = c("A: Drug X", "C: Combination") + ), + ARMCD = list( + ref = "ARM B", + comp = c("ARM A", "ARM C") + ) + ) + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_forest_tte( + label = "Forest Survival", + dataname = "ADTTE", + arm_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("ARM", "ARMCD")), + "ARMCD" + ), + arm_ref_comp = arm_ref_comp, + paramcd = teal.transform::choices_selected( + teal.transform::value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), + "OS" + ), + subgroup_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], names(data[["ADSL"]])), + c("BMRKR2", "SEX") + ), + strata_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("STRATA1", "STRATA2")), + "STRATA2" + ) + ) + ) + ) +} + +testthat::test_that("e2e - tm_g_forest_tte: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_forest_tte() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_km.R b/tests/testthat/test-shinytest2-tm_g_km.R new file mode 100644 index 0000000000..ab481f1311 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_km.R @@ -0,0 +1,65 @@ +app_driver_tm_g_km <- function() { + data <- teal.data::teal_data() %>% + within({ + ADSL <- tmc_ex_adsl + ADTTE <- tmc_ex_adtte + }) + + datanames <- c("ADSL", "ADTTE") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + arm_ref_comp <- list( + ACTARMCD = list( + ref = "ARM B", + comp = c("ARM A", "ARM C") + ), + ARM = list( + ref = "B: Placebo", + comp = c("A: Drug X", "C: Combination") + ) + ) + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_km( + label = "Kaplan-Meier Plot", + dataname = "ADTTE", + arm_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("ARM", "ARMCD", "ACTARMCD")), + "ARM" + ), + paramcd = teal.transform::choices_selected( + teal.transform::value_choices(data[["ADTTE"]], "PARAMCD", "PARAM"), + "OS" + ), + arm_ref_comp = arm_ref_comp, + strata_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("SEX", "BMRKR2")), + "SEX" + ), + facet_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("SEX", "BMRKR2")), + NULL + ) + ) + ) + ) +} + +testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_km() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_lineplot.R b/tests/testthat/test-shinytest2-tm_g_lineplot.R new file mode 100644 index 0000000000..13982b823d --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_lineplot.R @@ -0,0 +1,53 @@ +app_driver_tm_g_lineplot <- function() { + data <- teal.data::teal_data() %>% + within({ + library(dplyr) + library(forcats) + + ADSL <- tmc_ex_adsl + ADLB <- tmc_ex_adlb %>% + mutate(AVISIT == fct_reorder(AVISIT, AVISITN, min)) + }) + + datanames <- c("ADSL", "ADLB") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_lineplot( + label = "Line Plot", + dataname = "ADLB", + strata = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADSL"]], c("ARM", "ARMCD", "ACTARMCD")), + "ARM" + ), + y = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], c("AVAL", "BASE", "CHG", "PCHG")), + "AVAL" + ), + param = teal.transform::choices_selected( + teal.transform::value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + "ALT" + ) + ) + ) + ) +} + +testthat::test_that("e2e - tm_g_lineplot: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_lineplot() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R new file mode 100644 index 0000000000..55738e51d5 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R @@ -0,0 +1,70 @@ +app_driver_tm_g_pp_adverse_events <- function() { # nolint: object_length + data <- teal.data::teal_data() %>% + within({ + library(dplyr) + ADAE <- tmc_ex_adae + ADSL <- tmc_ex_adsl %>% + filter(USUBJID %in% ADAE$USUBJID) + }) + + datanames <- c("ADSL", "ADAE") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_pp_adverse_events( + label = "Adverse Events", + dataname = "ADAE", + parentname = "ADSL", + patient_col = "USUBJID", + plot_height = c(600L, 200L, 2000L), + aeterm = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "AETERM"), + selected = "AETERM" + ), + tox_grade = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "AETOXGR"), + selected = "AETOXGR" + ), + causality = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "AEREL"), + selected = "AEREL" + ), + outcome = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "AEOUT"), + selected = "AEOUT" + ), + action = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "AEACN"), + selected = "AEACN" + ), + time = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADAE"]], "ASTDY"), + selected = "ASTDY" + ), + decod = NULL + ) + ) + ) +} + +testthat::test_that( + "e2e - tm_g_pp_adverse_events: module initializes in teal without errors and produces plot output", + { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_pp_adverse_events() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() + } +) diff --git a/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R new file mode 100644 index 0000000000..22b5ebffe2 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R @@ -0,0 +1,19 @@ +app_driver_tm_g_km <- function() { + +} + +testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_km() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_pp_therapy.R b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R new file mode 100644 index 0000000000..67cecce53c --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R @@ -0,0 +1,86 @@ +# Error +app_driver_tm_g_pp_therapy <- function() { + data <- teal.data::teal_data() %>% + within({ + library(dplyr) + ADCM <- tmc_ex_adcm + ADSL <- tmc_ex_adsl %>% + filter(USUBJID %in% ADCM$USUBJID) + ADCM$CMASTDTM <- ADCM$ASTDTM + ADCM$CMAENDTM <- ADCM$AENDTM + adcm_keys <- c("STUDYID", "USUBJID", "ASTDTM", "CMSEQ", "ATC1", "ATC2", "ATC3", "ATC4") + }) + + datanames <- c("ADSL", "ADCM") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_g_pp_therapy( + label = "Therapy", + dataname = "ADCM", + parentname = "ADSL", + patient_col = "USUBJID", + plot_height = c(600L, 200L, 2000L), + atirel = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "ATIREL"), + selected = c("ATIREL") + ), + cmdecod = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMDECOD"), + selected = "CMDECOD" + ), + cmindc = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMINDC"), + selected = "CMINDC" + ), + cmdose = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMDOSE"), + selected = "CMDOSE" + ), + cmtrt = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMTRT"), + selected = "CMTRT" + ), + cmdosu = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMDOSU"), + selected = c("CMDOSU") + ), + cmroute = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMROUTE"), + selected = "CMROUTE" + ), + cmdosfrq = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "CMDOSFRQ"), + selected = "CMDOSFRQ" + ), + cmstdy = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "ASTDY"), + selected = "ASTDY" + ), + cmendy = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADCM"]], "AENDY"), + selected = "AENDY" + ) + ) + ) + ) +} + +testthat::test_that("e2e - tm_g_pp_therapy: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_pp_therapy() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_g_pp_vitals.R b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R new file mode 100644 index 0000000000..22b5ebffe2 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R @@ -0,0 +1,19 @@ +app_driver_tm_g_km <- function() { + +} + +testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_km() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality.R b/tests/testthat/test-shinytest2-tm_t_abnormality.R new file mode 100644 index 0000000000..642450c149 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_abnormality.R @@ -0,0 +1,61 @@ +app_driver_tm_t_abnormality <- function() { + data <- teal.data::teal_data() + data <- within(data, { + library(dplyr) + + ADSL <- tmc_ex_adsl + ADLB <- tmc_ex_adlb %>% + mutate( + ONTRTFL = case_when( + AVISIT %in% c("SCREENING", "BASELINE") ~ "", + TRUE ~ "Y" + ) %>% with_label("On Treatment Record Flag") + ) + }) + datanames <- c("ADSL", "ADLB") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_t_abnormality( + label = "Abnormality Table", + dataname = "ADLB", + arm_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADSL"]], subset = c("ARM", "ARMCD")), + selected = "ARM" + ), + add_total = FALSE, + by_vars = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADLB"]], subset = c("LBCAT", "PARAM", "AVISIT")), + selected = c("LBCAT", "PARAM"), + keep_order = TRUE + ), + baseline_var = teal.transform::choices_selected( + teal.transform::variable_choices(data[["ADLB"]], subset = "BNRIND"), + selected = "BNRIND", fixed = TRUE + ), + grade = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADLB"]], subset = "ANRIND"), + selected = "ANRIND", + fixed = TRUE + ), + abnormal = list(low = "LOW", high = "HIGH"), + exclude_base_abn = FALSE + ) + ) + ) +} + +testthat::test_that("e2e - tm_t_abnormality: module initializes in teal without errors and produces table output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_abnormality() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_true( + app_driver$is_visible(app_driver$active_module_element("table-table-with-settings")) + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R new file mode 100644 index 0000000000..618d911a04 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R @@ -0,0 +1,52 @@ +app_driver_tm_t_abnormality_by_worst_grade <- function() { # nolint: object_length + data <- teal.data::teal_data() %>% + within({ + library(dplyr) + + ADSL <- tmc_ex_adsl + ADLB <- tmc_ex_adlb %>% + filter(!AVISIT %in% c("SCREENING", "BASELINE")) + }) + + datanames <- c("ADSL", "ADLB") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_t_abnormality_by_worst_grade( + label = "Laboratory Test Results with Highest Grade Post-Baseline", + dataname = "ADLB", + arm_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADSL"]], subset = c("ARM", "ARMCD")), + selected = "ARM" + ), + paramcd = teal.transform::choices_selected( + choices = teal.transform::value_choices(data[["ADLB"]], "PARAMCD", "PARAM"), + selected = c("ALT", "CRP", "IGA") + ), + add_total = FALSE + ) + ), + filter = teal::teal_slices( + teal.slice::teal_slice("ADSL", "SAFFL", selected = "Y"), + teal.slice::teal_slice("ADLB", "ONTRTFL", selected = "Y") + ) + ) +} + +testthat::test_that( + "e2e - tm_t_abnormality_by_worst_grade: module initializes in teal without errors and produces table output", + { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_abnormality_by_worst_grade() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_true( + app_driver$is_visible(app_driver$active_module_element("table-table-with-settings")) + ) + app_driver$stop() + } +) diff --git a/tests/testthat/test-shinytest2-tm_t_ancova.R b/tests/testthat/test-shinytest2-tm_t_ancova.R new file mode 100644 index 0000000000..9c5b6869cd --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_ancova.R @@ -0,0 +1,69 @@ +app_driver_tm_t_ancova <- function() { + data <- teal.data::teal_data() %>% + within({ + ADSL <- tmc_ex_adsl + ADQS <- tmc_ex_adqs + }) + + datanames <- c("ADSL", "ADQS") + teal.data::datanames(data) <- datanames + teal.data::join_keys(data) <- teal.data::default_cdisc_join_keys[datanames] + + arm_ref_comp <- list( + ARM = list( + ref = "B: Placebo", + comp = c("A: Drug X", "C: Combination") + ), + ACTARMCD = list( + ref = "ARM B", + comp = c("ARM A", "ARM C") + ) + ) + + init_teal_app_driver( + data = data, + modules = teal::modules( + tm_t_ancova( + label = "ANCOVA Table", + dataname = "ADQS", + avisit = teal.transform::choices_selected( + choices = teal.transform::value_choices(data[["ADQS"]], "AVISIT"), + selected = "WEEK 1 DAY 8" + ), + arm_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADSL"]], c("ARM", "ACTARMCD", "ARMCD")), + selected = "ARMCD" + ), + arm_ref_comp = arm_ref_comp, + aval_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADQS"]], c("CHG", "AVAL")), + selected = "CHG" + ), + cov_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADQS"]], c("BASE", "STRATA1", "SEX")), + selected = "STRATA1" + ), + paramcd = teal.transform::choices_selected( + choices = teal.transform::value_choices(data[["ADQS"]], "PARAMCD", "PARAM"), + selected = "FKSI-FWB" + ), + interact_var = teal.transform::choices_selected( + choices = teal.transform::variable_choices(data[["ADQS"]], c("BASE", "STRATA1", "SEX")), + selected = "STRATA1" + ) + ) + ) + ) +} + +testthat::test_that("e2e - tm_t_ancova: module initializes in teal without errors and produces table output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_ancova() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_true( + app_driver$is_visible(app_driver$active_module_element("table-table-with-settings")) + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R new file mode 100644 index 0000000000..5ebfb0086d --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R @@ -0,0 +1,12 @@ +app_driver_tm_t_binary_outcome <- function() { + +} + +testthat::test_that("e2e - tm_t_binary_outcome: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_binary_outcome() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_coxreg.R b/tests/testthat/test-shinytest2-tm_t_coxreg.R new file mode 100644 index 0000000000..22b5ebffe2 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_coxreg.R @@ -0,0 +1,19 @@ +app_driver_tm_g_km <- function() { + +} + +testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_g_km() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + testthat::expect_match( + app_driver$get_attr( + app_driver$active_module_element("myplot-plot_main > img"), + "src" + ), + "data:image/png;base64," + ) + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_events.R b/tests/testthat/test-shinytest2-tm_t_events.R new file mode 100644 index 0000000000..5b4e501910 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_events.R @@ -0,0 +1,12 @@ +app_driver_tm_t_events <- function() { + +} + +testthat::test_that("e2e - tm_t_events: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_events() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R new file mode 100644 index 0000000000..26175b25c9 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R @@ -0,0 +1,12 @@ +app_driver_tm_t_events_by_grade <- function() { + +} + +testthat::test_that("e2e - tm_t_events_by_grade: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_events_by_grade() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_events_patyear.R b/tests/testthat/test-shinytest2-tm_t_events_patyear.R new file mode 100644 index 0000000000..8a3ad7b962 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_events_patyear.R @@ -0,0 +1,12 @@ +app_driver_tm_t_events_patyear <- function() { + +} + +testthat::test_that("e2e - tm_t_events_patyear: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_events_patyear() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_events_summary.R b/tests/testthat/test-shinytest2-tm_t_events_summary.R new file mode 100644 index 0000000000..8348c07482 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_events_summary.R @@ -0,0 +1,12 @@ +app_driver_tm_t_events_summary <- function() { + +} + +testthat::test_that("e2e - tm_t_events_summary: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_events_summary() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_exposure.R b/tests/testthat/test-shinytest2-tm_t_exposure.R new file mode 100644 index 0000000000..63c04ad83e --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_exposure.R @@ -0,0 +1,12 @@ +app_driver_tm_t_exposure <- function() { + +} + +testthat::test_that("e2e - tm_t_exposure: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_exposure() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_logistic.R b/tests/testthat/test-shinytest2-tm_t_logistic.R new file mode 100644 index 0000000000..509076213a --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_logistic.R @@ -0,0 +1,12 @@ +app_driver_tm_t_logistic <- function() { + +} + +testthat::test_that("e2e - tm_t_logistic: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_logistic() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_mult_events.R b/tests/testthat/test-shinytest2-tm_t_mult_events.R new file mode 100644 index 0000000000..ad175011a6 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_mult_events.R @@ -0,0 +1,12 @@ +app_driver_tm_t_mult_events <- function() { + +} + +testthat::test_that("e2e - tm_t_mult_events: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_mult_events() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R new file mode 100644 index 0000000000..b11f22bf03 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R @@ -0,0 +1,12 @@ +app_driver_tm_t_pp_basic_info <- function() { + +} + +testthat::test_that("e2e - tm_t_pp_basic_info: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_pp_basic_info() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R new file mode 100644 index 0000000000..3a5a2d23cc --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R @@ -0,0 +1,12 @@ +app_driver_tm_t_pp_laboratory <- function() { + +} + +testthat::test_that("e2e - tm_t_pp_laboratory: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_pp_laboratory() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R new file mode 100644 index 0000000000..1217d7fe2d --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R @@ -0,0 +1,14 @@ +app_driver_tm_t_pp_medical_history <- function() { # nolint: object_length +} + +testthat::test_that( + "e2e - tm_t_pp_medical_history: module initializes in teal without errors and produces plot output", + { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_pp_medical_history() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() + } +) diff --git a/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R new file mode 100644 index 0000000000..693298739a --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R @@ -0,0 +1,14 @@ +app_driver_tm_t_pp_prior_medication <- function() { # nolint: object_length +} + +testthat::test_that( + "e2e - tm_t_pp_prior_medication: module initializes in teal without errors and produces plot output", + { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_pp_prior_medication() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() + } +) diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R new file mode 100644 index 0000000000..bc1d8521b9 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R @@ -0,0 +1,12 @@ +app_driver_tm_t_shift_by_arm <- function() { + +} + +testthat::test_that("e2e - tm_t_shift_by_arm: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_shift_by_arm() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R new file mode 100644 index 0000000000..44dc60ae51 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R @@ -0,0 +1,15 @@ +app_driver_tm_t_shift_by_arm_by_worst <- function() { + +} + +testthat::test_that( + "e2e - tm_t_shift_by_arm_by_worst: module initializes in teal without errors and produces plot output", + { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_shift_by_arm_by_worst() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() + } +) diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R new file mode 100644 index 0000000000..1e2ad41bfc --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R @@ -0,0 +1,12 @@ +app_driver_tm_t_shift_by_grade <- function() { + +} + +testthat::test_that("e2e - tm_t_shift_by_grade: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_shift_by_grade() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_smq.R b/tests/testthat/test-shinytest2-tm_t_smq.R new file mode 100644 index 0000000000..9b07dafee9 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_smq.R @@ -0,0 +1,12 @@ +app_driver_tm_t_smq <- function() { + +} + +testthat::test_that("e2e - tm_t_smq: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_smq() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_summary.R b/tests/testthat/test-shinytest2-tm_t_summary.R new file mode 100644 index 0000000000..1a6676ef7e --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_summary.R @@ -0,0 +1,12 @@ +app_driver_tm_t_summary <- function() { + +} + +testthat::test_that("e2e - tm_t_summary: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_summary() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_summary_by.R b/tests/testthat/test-shinytest2-tm_t_summary_by.R new file mode 100644 index 0000000000..d519bc3a17 --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_summary_by.R @@ -0,0 +1,12 @@ +app_driver_tm_t_summary_by <- function() { + +} + +testthat::test_that("e2e - tm_t_summary_by: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_summary_by() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) diff --git a/tests/testthat/test-shinytest2-tm_t_tte.R b/tests/testthat/test-shinytest2-tm_t_tte.R new file mode 100644 index 0000000000..0fd467fe8a --- /dev/null +++ b/tests/testthat/test-shinytest2-tm_t_tte.R @@ -0,0 +1,12 @@ +app_driver_tm_t_tte <- function() { + +} + +testthat::test_that("e2e - tm_t_tte: module initializes in teal without errors and produces plot output", { + skip_if_too_deep(5) + app_driver <- app_driver_tm_t_tte() + app_driver$expect_no_shiny_error() + app_driver$expect_no_validation_error() + + app_driver$stop() +}) From 1c5c1108bea23975326e0be71ad87498edef6a83 Mon Sep 17 00:00:00 2001 From: vedhav Date: Tue, 23 Apr 2024 17:06:00 +0530 Subject: [PATCH 2/2] chore: start the test desc with a capital letter and end with . --- tests/testthat/test-shinytest2-tm_g_forest_tte copy.R | 2 +- tests/testthat/test-shinytest2-tm_g_forest_tte.R | 2 +- tests/testthat/test-shinytest2-tm_g_km.R | 2 +- tests/testthat/test-shinytest2-tm_g_lineplot.R | 2 +- tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R | 2 +- tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R | 2 +- tests/testthat/test-shinytest2-tm_g_pp_therapy.R | 2 +- tests/testthat/test-shinytest2-tm_g_pp_vitals.R | 2 +- tests/testthat/test-shinytest2-tm_t_abnormality.R | 2 +- .../test-shinytest2-tm_t_abnormality_by_worst_grade.R | 2 +- tests/testthat/test-shinytest2-tm_t_ancova.R | 6 +++--- tests/testthat/test-shinytest2-tm_t_binary_outcome.R | 2 +- tests/testthat/test-shinytest2-tm_t_coxreg.R | 2 +- tests/testthat/test-shinytest2-tm_t_events.R | 2 +- tests/testthat/test-shinytest2-tm_t_events_by_grade.R | 2 +- tests/testthat/test-shinytest2-tm_t_events_patyear.R | 2 +- tests/testthat/test-shinytest2-tm_t_events_summary.R | 2 +- tests/testthat/test-shinytest2-tm_t_exposure.R | 2 +- tests/testthat/test-shinytest2-tm_t_logistic.R | 2 +- tests/testthat/test-shinytest2-tm_t_mult_events.R | 2 +- tests/testthat/test-shinytest2-tm_t_pp_basic_info.R | 2 +- tests/testthat/test-shinytest2-tm_t_pp_laboratory.R | 2 +- tests/testthat/test-shinytest2-tm_t_pp_medical_history.R | 2 +- tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R | 2 +- tests/testthat/test-shinytest2-tm_t_shift_by_arm.R | 2 +- tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R | 2 +- tests/testthat/test-shinytest2-tm_t_shift_by_grade.R | 2 +- tests/testthat/test-shinytest2-tm_t_smq.R | 2 +- tests/testthat/test-shinytest2-tm_t_summary.R | 2 +- tests/testthat/test-shinytest2-tm_t_summary_by.R | 2 +- tests/testthat/test-shinytest2-tm_t_tte.R | 2 +- 31 files changed, 33 insertions(+), 33 deletions(-) diff --git a/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R b/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R index 951e2b1e63..efc81d2bfe 100644 --- a/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R +++ b/tests/testthat/test-shinytest2-tm_g_forest_tte copy.R @@ -60,7 +60,7 @@ app_driver_tm_g_ipp <- function() { ) } -testthat::test_that("e2e - tm_g_ipp: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_ipp: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_ipp() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_forest_tte.R b/tests/testthat/test-shinytest2-tm_g_forest_tte.R index 27063b326c..6772661bc7 100644 --- a/tests/testthat/test-shinytest2-tm_g_forest_tte.R +++ b/tests/testthat/test-shinytest2-tm_g_forest_tte.R @@ -52,7 +52,7 @@ app_driver_tm_g_forest_tte <- function() { ) } -testthat::test_that("e2e - tm_g_forest_tte: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_forest_tte: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_forest_tte() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_km.R b/tests/testthat/test-shinytest2-tm_g_km.R index ab481f1311..5bac87a8ac 100644 --- a/tests/testthat/test-shinytest2-tm_g_km.R +++ b/tests/testthat/test-shinytest2-tm_g_km.R @@ -48,7 +48,7 @@ app_driver_tm_g_km <- function() { ) } -testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_lineplot.R b/tests/testthat/test-shinytest2-tm_g_lineplot.R index 13982b823d..dbf02b4ba9 100644 --- a/tests/testthat/test-shinytest2-tm_g_lineplot.R +++ b/tests/testthat/test-shinytest2-tm_g_lineplot.R @@ -36,7 +36,7 @@ app_driver_tm_g_lineplot <- function() { ) } -testthat::test_that("e2e - tm_g_lineplot: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_lineplot: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_lineplot() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R index 55738e51d5..55fbddb8f4 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_adverse_events.R @@ -51,7 +51,7 @@ app_driver_tm_g_pp_adverse_events <- function() { # nolint: object_length } testthat::test_that( - "e2e - tm_g_pp_adverse_events: module initializes in teal without errors and produces plot output", + "e2e - tm_g_pp_adverse_events: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_adverse_events() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R index 22b5ebffe2..6abd2f1427 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_patient_timeline.R @@ -2,7 +2,7 @@ app_driver_tm_g_km <- function() { } -testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_therapy.R b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R index 67cecce53c..e10da4ad8e 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_therapy.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_therapy.R @@ -69,7 +69,7 @@ app_driver_tm_g_pp_therapy <- function() { ) } -testthat::test_that("e2e - tm_g_pp_therapy: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_pp_therapy: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_pp_therapy() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_g_pp_vitals.R b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R index 22b5ebffe2..6abd2f1427 100644 --- a/tests/testthat/test-shinytest2-tm_g_pp_vitals.R +++ b/tests/testthat/test-shinytest2-tm_g_pp_vitals.R @@ -2,7 +2,7 @@ app_driver_tm_g_km <- function() { } -testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality.R b/tests/testthat/test-shinytest2-tm_t_abnormality.R index 642450c149..d39f3ab80e 100644 --- a/tests/testthat/test-shinytest2-tm_t_abnormality.R +++ b/tests/testthat/test-shinytest2-tm_t_abnormality.R @@ -48,7 +48,7 @@ app_driver_tm_t_abnormality <- function() { ) } -testthat::test_that("e2e - tm_t_abnormality: module initializes in teal without errors and produces table output", { +testthat::test_that("e2e - tm_t_abnormality: Module initializes in teal without errors and produces table output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R index 618d911a04..7226eb3212 100644 --- a/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_abnormality_by_worst_grade.R @@ -37,7 +37,7 @@ app_driver_tm_t_abnormality_by_worst_grade <- function() { # nolint: object_leng } testthat::test_that( - "e2e - tm_t_abnormality_by_worst_grade: module initializes in teal without errors and produces table output", + "e2e - tm_t_abnormality_by_worst_grade: Module initializes in teal without errors and produces table output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_abnormality_by_worst_grade() diff --git a/tests/testthat/test-shinytest2-tm_t_ancova.R b/tests/testthat/test-shinytest2-tm_t_ancova.R index 9c5b6869cd..f2b21f3ae0 100644 --- a/tests/testthat/test-shinytest2-tm_t_ancova.R +++ b/tests/testthat/test-shinytest2-tm_t_ancova.R @@ -56,14 +56,14 @@ app_driver_tm_t_ancova <- function() { ) } -testthat::test_that("e2e - tm_t_ancova: module initializes in teal without errors and produces table output", { +testthat::test_that("e2e - tm_t_ancova: Module initializes in teal without errors and produces table output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_ancova() app_driver$expect_no_shiny_error() app_driver$expect_no_validation_error() testthat::expect_true( - app_driver$is_visible(app_driver$active_module_element("table-table-with-settings")) - ) + app_driver$is_visible(app_driver$active_module_element("table-table-with-settings")) + ) app_driver$stop() }) diff --git a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R index 5ebfb0086d..8f46115ca6 100644 --- a/tests/testthat/test-shinytest2-tm_t_binary_outcome.R +++ b/tests/testthat/test-shinytest2-tm_t_binary_outcome.R @@ -2,7 +2,7 @@ app_driver_tm_t_binary_outcome <- function() { } -testthat::test_that("e2e - tm_t_binary_outcome: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_binary_outcome: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_binary_outcome() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_coxreg.R b/tests/testthat/test-shinytest2-tm_t_coxreg.R index 22b5ebffe2..6abd2f1427 100644 --- a/tests/testthat/test-shinytest2-tm_t_coxreg.R +++ b/tests/testthat/test-shinytest2-tm_t_coxreg.R @@ -2,7 +2,7 @@ app_driver_tm_g_km <- function() { } -testthat::test_that("e2e - tm_g_km: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_g_km: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_g_km() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_events.R b/tests/testthat/test-shinytest2-tm_t_events.R index 5b4e501910..6c93cc6cd6 100644 --- a/tests/testthat/test-shinytest2-tm_t_events.R +++ b/tests/testthat/test-shinytest2-tm_t_events.R @@ -2,7 +2,7 @@ app_driver_tm_t_events <- function() { } -testthat::test_that("e2e - tm_t_events: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_events: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_events() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R index 26175b25c9..9176a4058e 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_by_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_events_by_grade.R @@ -2,7 +2,7 @@ app_driver_tm_t_events_by_grade <- function() { } -testthat::test_that("e2e - tm_t_events_by_grade: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_events_by_grade: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_by_grade() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_events_patyear.R b/tests/testthat/test-shinytest2-tm_t_events_patyear.R index 8a3ad7b962..3d5731903f 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_patyear.R +++ b/tests/testthat/test-shinytest2-tm_t_events_patyear.R @@ -2,7 +2,7 @@ app_driver_tm_t_events_patyear <- function() { } -testthat::test_that("e2e - tm_t_events_patyear: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_events_patyear: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_patyear() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_events_summary.R b/tests/testthat/test-shinytest2-tm_t_events_summary.R index 8348c07482..9c7b76e735 100644 --- a/tests/testthat/test-shinytest2-tm_t_events_summary.R +++ b/tests/testthat/test-shinytest2-tm_t_events_summary.R @@ -2,7 +2,7 @@ app_driver_tm_t_events_summary <- function() { } -testthat::test_that("e2e - tm_t_events_summary: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_events_summary: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_events_summary() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_exposure.R b/tests/testthat/test-shinytest2-tm_t_exposure.R index 63c04ad83e..82bcd2ae53 100644 --- a/tests/testthat/test-shinytest2-tm_t_exposure.R +++ b/tests/testthat/test-shinytest2-tm_t_exposure.R @@ -2,7 +2,7 @@ app_driver_tm_t_exposure <- function() { } -testthat::test_that("e2e - tm_t_exposure: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_exposure: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_exposure() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_logistic.R b/tests/testthat/test-shinytest2-tm_t_logistic.R index 509076213a..1ed65db570 100644 --- a/tests/testthat/test-shinytest2-tm_t_logistic.R +++ b/tests/testthat/test-shinytest2-tm_t_logistic.R @@ -2,7 +2,7 @@ app_driver_tm_t_logistic <- function() { } -testthat::test_that("e2e - tm_t_logistic: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_logistic: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_logistic() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_mult_events.R b/tests/testthat/test-shinytest2-tm_t_mult_events.R index ad175011a6..f871cefbbb 100644 --- a/tests/testthat/test-shinytest2-tm_t_mult_events.R +++ b/tests/testthat/test-shinytest2-tm_t_mult_events.R @@ -2,7 +2,7 @@ app_driver_tm_t_mult_events <- function() { } -testthat::test_that("e2e - tm_t_mult_events: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_mult_events: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_mult_events() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R index b11f22bf03..a9ef25f3e4 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_basic_info.R @@ -2,7 +2,7 @@ app_driver_tm_t_pp_basic_info <- function() { } -testthat::test_that("e2e - tm_t_pp_basic_info: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_pp_basic_info: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_basic_info() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R index 3a5a2d23cc..2d4df6f817 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_laboratory.R @@ -2,7 +2,7 @@ app_driver_tm_t_pp_laboratory <- function() { } -testthat::test_that("e2e - tm_t_pp_laboratory: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_pp_laboratory: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_laboratory() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R index 1217d7fe2d..dffd5217a2 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_medical_history.R @@ -2,7 +2,7 @@ app_driver_tm_t_pp_medical_history <- function() { # nolint: object_length } testthat::test_that( - "e2e - tm_t_pp_medical_history: module initializes in teal without errors and produces plot output", + "e2e - tm_t_pp_medical_history: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_medical_history() diff --git a/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R index 693298739a..f2f61c99c3 100644 --- a/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R +++ b/tests/testthat/test-shinytest2-tm_t_pp_prior_medication.R @@ -2,7 +2,7 @@ app_driver_tm_t_pp_prior_medication <- function() { # nolint: object_length } testthat::test_that( - "e2e - tm_t_pp_prior_medication: module initializes in teal without errors and produces plot output", + "e2e - tm_t_pp_prior_medication: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_pp_prior_medication() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R index bc1d8521b9..43b85288de 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm.R @@ -2,7 +2,7 @@ app_driver_tm_t_shift_by_arm <- function() { } -testthat::test_that("e2e - tm_t_shift_by_arm: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_shift_by_arm: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R index 44dc60ae51..8e842dbb51 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_arm_by_worst.R @@ -3,7 +3,7 @@ app_driver_tm_t_shift_by_arm_by_worst <- function() { } testthat::test_that( - "e2e - tm_t_shift_by_arm_by_worst: module initializes in teal without errors and produces plot output", + "e2e - tm_t_shift_by_arm_by_worst: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_arm_by_worst() diff --git a/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R index 1e2ad41bfc..52deee1719 100644 --- a/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R +++ b/tests/testthat/test-shinytest2-tm_t_shift_by_grade.R @@ -2,7 +2,7 @@ app_driver_tm_t_shift_by_grade <- function() { } -testthat::test_that("e2e - tm_t_shift_by_grade: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_shift_by_grade: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_shift_by_grade() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_smq.R b/tests/testthat/test-shinytest2-tm_t_smq.R index 9b07dafee9..d2c128fdf4 100644 --- a/tests/testthat/test-shinytest2-tm_t_smq.R +++ b/tests/testthat/test-shinytest2-tm_t_smq.R @@ -2,7 +2,7 @@ app_driver_tm_t_smq <- function() { } -testthat::test_that("e2e - tm_t_smq: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_smq: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_smq() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_summary.R b/tests/testthat/test-shinytest2-tm_t_summary.R index 1a6676ef7e..69249c8580 100644 --- a/tests/testthat/test-shinytest2-tm_t_summary.R +++ b/tests/testthat/test-shinytest2-tm_t_summary.R @@ -2,7 +2,7 @@ app_driver_tm_t_summary <- function() { } -testthat::test_that("e2e - tm_t_summary: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_summary: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_summary_by.R b/tests/testthat/test-shinytest2-tm_t_summary_by.R index d519bc3a17..789f0b1304 100644 --- a/tests/testthat/test-shinytest2-tm_t_summary_by.R +++ b/tests/testthat/test-shinytest2-tm_t_summary_by.R @@ -2,7 +2,7 @@ app_driver_tm_t_summary_by <- function() { } -testthat::test_that("e2e - tm_t_summary_by: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_summary_by: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_summary_by() app_driver$expect_no_shiny_error() diff --git a/tests/testthat/test-shinytest2-tm_t_tte.R b/tests/testthat/test-shinytest2-tm_t_tte.R index 0fd467fe8a..ecdd08a44f 100644 --- a/tests/testthat/test-shinytest2-tm_t_tte.R +++ b/tests/testthat/test-shinytest2-tm_t_tte.R @@ -2,7 +2,7 @@ app_driver_tm_t_tte <- function() { } -testthat::test_that("e2e - tm_t_tte: module initializes in teal without errors and produces plot output", { +testthat::test_that("e2e - tm_t_tte: Module initializes in teal without errors and produces plot output.", { skip_if_too_deep(5) app_driver <- app_driver_tm_t_tte() app_driver$expect_no_shiny_error()