Skip to content

Commit

Permalink
test with MAE object added in the transform
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Oct 30, 2024
1 parent c32d451 commit 2092a6b
Showing 1 changed file with 44 additions and 0 deletions.
44 changes: 44 additions & 0 deletions tests/testthat/test-module_teal.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 2092a6b

Please sign in to comment.