diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 59a4d1c2b5..44d62f7831 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -2206,6 +2206,50 @@ testthat::describe("srv_teal summary table", { ) }) + testthat::test_that("summary table displays MAE dataset added in transforms", { + data <- within(teal.data::teal_data(), { + iris <- iris + mtcars <- mtcars + foo <- identity + }) + shiny::testServer( + app = srv_teal, + args = list( + id = "test", + data = data, + modules = modules(module("module_1", server = function(id, data) data, datanames = "all", transformers = list( + teal_transform_module( + server = function(id, data) { + reactive({ + within(data(), { + withr::with_package("MultiAssayExperiment", { + data("miniACC", package = "MultiAssayExperiment", envir = environment()) + }) + }) + }) + } + ) + ))) + ), + expr = { + # throws warning as data("miniACC") hasn't been detected as miniACC dependency + suppressWarnings(session$setInputs("teal_modules-active_tab" = "module_1")) + testthat::expect_equal( + module_summary_table(output, "module_1"), + data.frame( + "Data Name" = c( + "foo", "iris", "miniACC", "- RNASeq2GeneNorm", "- gistict", + "- RPPAArray", "- Mutations", "- miRNASeqGene", "mtcars" + ), + Obs = c("", "150/150", "", "198", "198", "33", "97", "471", "32/32"), + Subjects = c(NA_integer_, NA_integer_, 92, 79, 90, 46, 90, 80, NA_integer_), + check.names = FALSE + ) + ) + } + ) + }) + testthat::it("displays unsupported datasets", { data <- within(teal.data::teal_data(), { iris <- iris