Skip to content

Commit

Permalink
chore: fix broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
vedhav committed Nov 1, 2024
1 parent f87a0a5 commit ecf6b8e
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 21 deletions.
10 changes: 5 additions & 5 deletions tests/testthat/test-module_teal.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
)
)
Expand All @@ -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
)
)
Expand Down
29 changes: 13 additions & 16 deletions tests/testthat/test-shinytest2-data_summary.R
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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")))
Expand All @@ -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")))
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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
)
)
Expand All @@ -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")))
Expand Down

0 comments on commit ecf6b8e

Please sign in to comment.