diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 44d62f7831..0ddf0e7717 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -2238,11 +2238,11 @@ testthat::describe("srv_teal summary table", { module_summary_table(output, "module_1"), data.frame( "Data Name" = c( - "foo", "iris", "miniACC", "- RNASeq2GeneNorm", "- gistict", + "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_), + Obs = c("150/150", "", "198", "198", "33", "97", "471", "32/32"), + Subjects = c(NA_integer_, 92, 79, 90, 46, 90, 80, NA_integer_), check.names = FALSE ) ) @@ -2269,8 +2269,8 @@ testthat::describe("srv_teal summary table", { testthat::expect_identical( module_summary_table(output, "module_1"), data.frame( - "Data Name" = c("foo", "iris", "mtcars"), - Obs = c("", "150/150", "32/32"), + "Data Name" = c("iris", "mtcars"), + Obs = c("150/150", "32/32"), check.names = FALSE ) ) diff --git a/tests/testthat/test-shinytest2-data_summary.R b/tests/testthat/test-shinytest2-data_summary.R index 16cba15bc7..30f2fcf89d 100644 --- a/tests/testthat/test-shinytest2-data_summary.R +++ b/tests/testthat/test-shinytest2-data_summary.R @@ -1,23 +1,20 @@ -testthat::test_that("e2e: data summary list only data names if there is no MAE or data.frames in teal_data", { +testthat::test_that("e2e: data summary just list the unfilterable objects at the bottom when provided", { skip_if_too_deep(5) app <- TealAppDriver$new( - data = teal.data::teal_data(x = 1), + data = teal.data::teal_data(x = 1, y = "z", foo = function() NULL), modules = example_module() ) - testthat::expect_identical( - as.data.frame(app$get_active_data_summary_table()), - data.frame( - `Data Name` = c("x"), - check.names = FALSE - ) + testthat::expect_match( + app$get_text(sprintf("#%s", app$active_data_summary_ns())), + "\\+3 unfilterable dataset\\(s\\)" ) app$stop() }) -testthat::test_that("e2e: data summary is displayed with 2 columns data without keys", { +testthat::test_that("e2e: data summary table is displayed with 2 columns data without keys", { skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), # iris, mtcars @@ -36,7 +33,7 @@ testthat::test_that("e2e: data summary is displayed with 2 columns data without app$stop() }) -testthat::test_that("e2e: data summary displays datasets by topological_sort of join_keys", { +testthat::test_that("e2e: data summary table displays datasets by topological_sort of join_keys", { skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) @@ -58,7 +55,7 @@ testthat::test_that("e2e: data summary displays datasets by topological_sort of app$stop() }) -testthat::test_that("e2e: data summary is displayed with 3 columns for data with join keys", { +testthat::test_that("e2e: data summary table is displayed with 3 columns for data with join keys", { skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) @@ -86,7 +83,7 @@ testthat::test_that("e2e: data summary is displayed with 3 columns for data with }) testthat::test_that( - "e2e: data summary contains row count of data.frames, MAE objects and unsupported", + "e2e: data summary table does not list unsupported objects", { testthat::skip_if_not_installed("MultiAssayExperiment") skip_if_too_deep(5) @@ -117,10 +114,10 @@ testthat::test_that( data.frame( `Data Name` = c( "iris", "miniACC", "- RNASeq2GeneNorm", "- gistict", "- RPPAArray", "- Mutations", "- miRNASeqGene", - "mtcars2", "mtcars1", "unsupported" + "mtcars2", "mtcars1" ), - Obs = c("150/150", "", "198/198", "198/198", "33/33", "97/97", "471/471", "2/2", "32/32", ""), - Subjects = c("", "92/92", "79/79", "90/90", "46/46", "90/90", "80/80", "", "2/2", ""), + Obs = c("150/150", "", "198/198", "198/198", "33/33", "97/97", "471/471", "2/2", "32/32"), + Subjects = c("", "92/92", "79/79", "90/90", "46/46", "90/90", "80/80", "", "2/2"), check.names = FALSE ) ) @@ -129,7 +126,7 @@ testthat::test_that( } ) -testthat::test_that("e2e: data summary displays datasets by datanames() order if no join_keys", { +testthat::test_that("e2e: data summary table displays datasets by datanames() order if no join_keys", { skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b")))