diff --git a/R/TealAppDriver.R b/R/TealAppDriver.R index fa4c467231..58c927840b 100644 --- a/R/TealAppDriver.R +++ b/R/TealAppDriver.R @@ -452,7 +452,7 @@ TealAppDriver <- R6::R6Class( # nolint: object_name. replacement = "", self$get_text( sprintf( - "#%s-filters-%s .filter-card-varname", + "#%s-filters-%s-container .filter-card-varname", self$active_filters_ns(), x ) diff --git a/R/reporter_previewer_module.R b/R/reporter_previewer_module.R index 20ee7aa19a..cd7599076f 100644 --- a/R/reporter_previewer_module.R +++ b/R/reporter_previewer_module.R @@ -50,10 +50,11 @@ reporter_previewer_module <- function(label = "Report previewer", server_args = server = srv, ui = ui, server_args = server_args, ui_args = list(), datanames = NULL ) - # Module is created with a placeholder label and the label is changed later. + # Module is created with a placeholder label and path and both are changed later. # This is to prevent another module being labeled "Report previewer". class(module) <- c(class(module), "teal_module_previewer") module$label <- label + module$path <- label attr(module, "teal_bookmarkable") <- TRUE module } diff --git a/R/utils.R b/R/utils.R index 7c551cf834..52f5af400b 100644 --- a/R/utils.R +++ b/R/utils.R @@ -359,7 +359,9 @@ create_app_id <- function(data, modules) { } modules <- lapply(modules, defunction) - rlang::hash(list(data = data, modules = modules)) + # Suppress warnings of type: `package:MultiAssayExperiment' may not be available when loading` + # This is because the package namespace may be part of the `data` object + suppressWarnings(rlang::hash(list(data = data, modules = modules))) } #' Go through list and extract bodies of encountered functions as string, recursively. diff --git a/inst/css/sidebar.css b/inst/css/sidebar.css index 3199abc2d0..d62009e33b 100644 --- a/inst/css/sidebar.css +++ b/inst/css/sidebar.css @@ -64,13 +64,13 @@ a.disabled { --bs-accordion-active-bg: rgba(var(--bs-secondary-rgb), 0.3); } -.teal-transform-accordian .accordion-button { +.teal-transform-accordion .accordion-button { --bs-accordion-btn-padding-y: 0.5rem; --bs-accordion-btn-padding-x: 0.5rem; } -.teal-transform-accordian .accordion-button:not(.collapsed)::after, -.teal-transform-accordian .accordion-button::after { +.teal-transform-accordion .accordion-button:not(.collapsed)::after, +.teal-transform-accordion .accordion-button::after { display: none; } diff --git a/tests/testthat/_snaps/linux-4.5/shinytest2-init/teal-001.png b/tests/testthat/_snaps/linux-4.5/shinytest2-init/teal-001.png new file mode 100644 index 0000000000..dc3837c731 Binary files /dev/null and b/tests/testthat/_snaps/linux-4.5/shinytest2-init/teal-001.png differ diff --git a/tests/testthat/_snaps/linux-4.5/shinytest2-wunder_bar/teal-001.png b/tests/testthat/_snaps/linux-4.5/shinytest2-wunder_bar/teal-001.png new file mode 100644 index 0000000000..f48a637ef3 Binary files /dev/null and b/tests/testthat/_snaps/linux-4.5/shinytest2-wunder_bar/teal-001.png differ diff --git a/tests/testthat/setup-testing_depth.R b/tests/testthat/helper-testing_depth.R similarity index 100% rename from tests/testthat/setup-testing_depth.R rename to tests/testthat/helper-testing_depth.R diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 5fd9fd109c..f0801765d8 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -466,7 +466,7 @@ testthat::describe("srv_teal teal_modules", { `teal_modules-active_module_id` = "module_1" ) out <- modules_output$module_1() - testthat::expect_true(!is.null(out)) + testthat::expect_type(out, "double") session$setInputs(`data-teal_data_module-dataset` = "mtcars") testthat::expect_identical(out, modules_output$module_1()) } diff --git a/tests/testthat/test-shinytest2-data_summary.R b/tests/testthat/test-shinytest2-data_summary.R index 769df97e7e..690e1f6ba5 100644 --- a/tests/testthat/test-shinytest2-data_summary.R +++ b/tests/testthat/test-shinytest2-data_summary.R @@ -1,5 +1,4 @@ testthat::test_that("e2e: data summary just list the unfilterable objects at the bottom when provided", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = teal.data::teal_data(x = 1, y = "z", foo = function() NULL), @@ -15,7 +14,6 @@ testthat::test_that("e2e: data summary just list the unfilterable objects at the }) testthat::test_that("e2e: data summary table is displayed with 2 columns data without keys", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), # iris, mtcars @@ -35,7 +33,6 @@ testthat::test_that("e2e: data summary table is displayed with 2 columns data wi }) testthat::test_that("e2e: data summary table displays datasets by topological_sort of join_keys", { - testthat::skip("chromium") skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) @@ -44,10 +41,7 @@ testthat::test_that("e2e: data summary table displays datasets by topological_so teal.data::join_key("mtcars2", "mtcars1", keys = c("am")) ) - app <- TealAppDriver$new( - data = data, - modules = example_module() - ) + app <- TealAppDriver$new(data = data, modules = example_module()) testthat::expect_identical( as.data.frame(app$get_active_data_summary_table())[["Data Name"]], @@ -58,7 +52,6 @@ testthat::test_that("e2e: data summary table displays datasets by topological_so }) testthat::test_that("e2e: data summary table is displayed with 3 columns for data with join keys", { - testthat::skip("chromium") skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) @@ -67,10 +60,7 @@ testthat::test_that("e2e: data summary table is displayed with 3 columns for dat teal.data::join_key("mtcars2", "mtcars1", keys = c("am")) ) - app <- TealAppDriver$new( - data = data, - modules = example_module() - ) + app <- TealAppDriver$new(data = data, modules = example_module()) testthat::expect_identical( as.data.frame(app$get_active_data_summary_table()), @@ -85,62 +75,51 @@ testthat::test_that("e2e: data summary table is displayed with 3 columns for dat app$stop() }) -testthat::test_that( - "e2e: data summary table does not list unsupported objects", - { - testthat::skip_if_not_installed("MultiAssayExperiment") - testthat::skip("chromium") - skip_if_too_deep(5) - - data <- within( - teal.data::teal_data(), - { - mtcars1 <- mtcars - mtcars2 <- data.frame(am = c(0, 1), test = c("a", "b")) - iris <- iris - library(MultiAssayExperiment) - data("miniACC", package = "MultiAssayExperiment", envir = environment()) - unsupported <- function(x) x - # nolint end: object_name. - } - ) +testthat::test_that("e2e: data summary table does not list unsupported objects", { + testthat::skip_if_not_installed("MultiAssayExperiment") + skip_if_too_deep(5) - teal.data::join_keys(data) <- teal.data::join_keys( - teal.data::join_key("mtcars2", "mtcars1", keys = c("am")) - ) + data <- within( + teal.data::teal_data(), + { + mtcars1 <- mtcars + mtcars2 <- data.frame(am = c(0, 1), test = c("a", "b")) + iris <- iris + library(MultiAssayExperiment) + data("miniACC", package = "MultiAssayExperiment", envir = environment()) + unsupported <- function(x) x + # nolint end: object_name. + } + ) - app <- TealAppDriver$new( - data = data, - modules = example_module() - ) + teal.data::join_keys(data) <- teal.data::join_keys( + teal.data::join_key("mtcars2", "mtcars1", keys = c("am")) + ) + + app <- TealAppDriver$new(data = data, modules = example_module()) - testthat::expect_identical( - as.data.frame(app$get_active_data_summary_table()), - data.frame( - `Data Name` = c( - "iris", "miniACC", "- RNASeq2GeneNorm", "- gistict", "- RPPAArray", "- Mutations", "- miRNASeqGene", - "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"), - check.names = FALSE - ) + testthat::expect_identical( + as.data.frame(app$get_active_data_summary_table()), + data.frame( + `Data Name` = c( + "iris", "miniACC", "- RNASeq2GeneNorm", "- gistict", "- RPPAArray", "- Mutations", "- miRNASeqGene", + "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"), + check.names = FALSE ) + ) - app$stop() - } -) + app$stop() +}) testthat::test_that("e2e: data summary table displays datasets by names() order if no join_keys", { - testthat::skip("chromium") skip_if_too_deep(5) data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) - app <- TealAppDriver$new( - data = data, - modules = example_module() - ) + app <- TealAppDriver$new(data = data, modules = example_module()) testthat::expect_identical( as.data.frame(app$get_active_data_summary_table())[["Data Name"]], @@ -149,3 +128,17 @@ testthat::test_that("e2e: data summary table displays datasets by names() order app$stop() }) + +testthat::test_that("e2e: data summary UI can be collpased and expanded (`bslib` regression)", { + skip_if_too_deep(5) + + data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) + app <- TealAppDriver$new(data = data, modules = example_module()) + + # Visible by default + testthat::expect_true(app$is_visible(".teal-active-data-summary-panel .accordion-collapse")) + app$click(selector = ".teal-active-data-summary-panel .accordion-header button") + testthat::expect_false(app$is_visible(".teal-active-data-summary-panel .accordion-collapse")) + + app$stop() +}) diff --git a/tests/testthat/test-shinytest2-decorators.R b/tests/testthat/test-shinytest2-decorators.R index 8f33bd8f48..9bab3a811e 100644 --- a/tests/testthat/test-shinytest2-decorators.R +++ b/tests/testthat/test-shinytest2-decorators.R @@ -2,7 +2,6 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: module with decorator UI and output is modified interactively upon changes in decorator", { - testthat::skip("chromium") skip_if_too_deep(5) interactive_decorator <- teal_transform_module( @@ -44,9 +43,7 @@ testthat::test_that("e2e: module with decorator UI and output is modified intera ) testthat::expect_identical( - app$active_module_element_text( - paste0(input_id, "-label") - ), + app$active_module_element_text(sprintf("%s-label", input_id)), "Append text" ) @@ -73,7 +70,6 @@ testthat::test_that("e2e: module with decorator UI and output is modified intera }) testthat::test_that("e2e: module with decorator, where server fails, shows shiny error message", { - testthat::skip("chromium") skip_if_too_deep(5) failing_decorator <- teal_transform_module( ui = function(id) { @@ -104,7 +100,7 @@ testthat::test_that("e2e: module with decorator, where server fails, shows shin app$expect_validation_error() - testthat::expect_setequal( + testthat::expect_identical( strsplit(app$active_module_element_text(input_id), "\n")[[1]], c( "Shiny error when executing the `data` module.", diff --git a/tests/testthat/test-shinytest2-filter_panel.R b/tests/testthat/test-shinytest2-filter_panel.R index 974c709c72..592e2fd95a 100644 --- a/tests/testthat/test-shinytest2-filter_panel.R +++ b/tests/testthat/test-shinytest2-filter_panel.R @@ -2,7 +2,6 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: module content is updated when data is filtered in filter panel", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -30,7 +29,6 @@ testthat::test_that("e2e: module content is updated when data is filtered in fil }) testthat::test_that("e2e: filtering a module-specific filter is reflected in other shared module", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -56,21 +54,15 @@ testthat::test_that("e2e: filtering a module-specific filter is reflected in oth ) app$navigate_teal_tab("Module_2") - - app$set_active_filter_selection("iris", "Species", c("setosa")) + app$set_active_filter_selection("iris", "Species", "setosa") app$navigate_teal_tab("Module_1") - - testthat::expect_equal( - app$get_active_data_filters("iris")$Species, - c("setosa") - ) + testthat::expect_equal(app$get_active_data_filters("iris")$Species, "setosa") app$stop() }) -testthat::test_that("e2e: filtering a module-specific filter is not refected in other unshared modules", { - testthat::skip("chromium") +testthat::test_that("e2e: filtering a module-specific filter is not reflected in other unshared modules", { skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -93,12 +85,26 @@ testthat::test_that("e2e: filtering a module-specific filter is not refected in testthat::expect_setequal(app$get_active_data_filters("mtcars")$cyl, c("4", "6")) app$navigate_teal_tab("Module_2") - app$set_active_filter_selection("mtcars", "cyl", c("4")) app$navigate_teal_tab("Module_1") - testthat::expect_setequal(app$get_active_data_filters("mtcars")$cyl, c("4", "6")) app$stop() }) + +testthat::test_that("e2e: filter panel UI can be collpased and expanded (`bslib` regression)", { + skip_if_too_deep(5) + + data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) + app <- TealAppDriver$new(data = data, modules = example_module()) + + # Visible by default + filter_panel_id <- "#teal-teal_modules-nav-example_teal_module-filter_panel-filters-main_filter_accordion" + filterpanel_accordion_selector <- paste(filter_panel_id, "> .accordion-item > .accordion-collapse") + testthat::expect_true(app$is_visible(filterpanel_accordion_selector)) + app$click(selector = paste(filter_panel_id, "> .accordion-item > .accordion-header button")) + testthat::expect_false(app$is_visible(filterpanel_accordion_selector)) + + app$stop() +}) diff --git a/tests/testthat/test-shinytest2-init.R b/tests/testthat/test-shinytest2-init.R index d6ca232318..4ba3a10c49 100644 --- a/tests/testthat/test-shinytest2-init.R +++ b/tests/testthat/test-shinytest2-init.R @@ -2,18 +2,17 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: teal app initializes with no errors", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), modules = example_module(label = "Example Module") ) app$expect_no_shiny_error() + app$expect_screenshot(selector = "#teal-tabpanel_wrapper") app$stop() }) testthat::test_that("e2e: teal app initializes with sessionInfo modal", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -69,7 +68,6 @@ testthat::test_that("e2e: teal app initializes with sessionInfo modal", { }) testthat::test_that("e2e: init creates UI containing specified title, favicon, header and footer", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), diff --git a/tests/testthat/test-shinytest2-landing_popup.R b/tests/testthat/test-shinytest2-landing_popup.R index 8aab4b276e..ffd9717f3d 100644 --- a/tests/testthat/test-shinytest2-landing_popup.R +++ b/tests/testthat/test-shinytest2-landing_popup.R @@ -2,13 +2,10 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: teal app with landing_popup_module initializes with no errors", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), - modules = modules( - example_module() - ), + modules = modules(example_module()), landing_popup_args = list( title = "Welcome", content = tags$b("A welcome message!", style = "color: red;") @@ -23,7 +20,6 @@ testthat::test_that("e2e: teal app with landing_popup_module initializes with no }) testthat::test_that("e2e: app with default landing_popup_module creates modal containing a button", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -42,7 +38,6 @@ testthat::test_that("e2e: app with default landing_popup_module creates modal co }) testthat::test_that("e2e: when default landing_popup_module is closed, it shows the underlying teal app", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -67,7 +62,6 @@ testthat::test_that("e2e: when default landing_popup_module is closed, it shows testthat::test_that( "e2e: app with customized landing_popup_module creates modal containing specified title, content and buttons", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( @@ -134,7 +128,6 @@ testthat::test_that( ) testthat::test_that("e2e: when customized button in landing_popup_module is clicked, it redirects to a certain page", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), diff --git a/tests/testthat/test-shinytest2-module_bookmark_manager.R b/tests/testthat/test-shinytest2-module_bookmark_manager.R index a913a36040..f1758aa50d 100644 --- a/tests/testthat/test-shinytest2-module_bookmark_manager.R +++ b/tests/testthat/test-shinytest2-module_bookmark_manager.R @@ -1,50 +1,43 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") -testthat::test_that("bookmark_manager_button is not rendered by default", { - testthat::skip("chromium") - skip_if_too_deep(5) - app <- TealAppDriver$new( - data = simple_teal_data(), - modules = example_module(label = "Example Module"), - options = list() - ) - on.exit(app$stop()) - testthat::expect_null( - app$get_html(".bookmark_manager_button") - ) -}) - - -testthat::test_that("bookmark_manager_button is not rendered when enableBookmarking = 'url'", { - testthat::skip("chromium") - skip_if_too_deep(5) - app <- TealAppDriver$new( - data = simple_teal_data(), - modules = example_module(label = "Example Module"), - options = list(shiny.bookmarkStore = "url") - ) - on.exit(app$stop()) - testthat::expect_null( - app$get_html(".bookmark_manager_button") - ) -}) +testthat::describe("bookmark_manager_button is", { + bookmark_manager_selector <- ".bookmark_manager_button" + it("not rendered by default", { + skip_if_too_deep(5) + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module"), + options = list() + ) + testthat::expect_null(app$get_html(bookmark_manager_selector)) + app$stop() + }) + it("not rendered when enableBookmarking = 'url'", { + skip_if_too_deep(5) + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module"), + options = list(shiny.bookmarkStore = "url") + ) + testthat::expect_null(app$get_html(bookmark_manager_selector)) + app$stop() + }) -testthat::test_that("bookmark_manager_button is rendered when enableBookmarking = 'server'", { - testthat::skip("chromium") - skip_if_too_deep(5) - app <- TealAppDriver$new( - data = simple_teal_data(), - modules = example_module(label = "Example Module"), - options = list(shiny.bookmarkStore = "server") - ) - on.exit(app$stop()) - testthat::expect_true(!is.null(app$get_html(".bookmark_manager_button"))) + it("rendered when enableBookmarking = 'server'", { + skip_if_too_deep(5) + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module"), + options = list(shiny.bookmarkStore = "server") + ) + testthat::expect_type(app$get_html(bookmark_manager_selector), "character") + app$stop() + }) }) testthat::test_that("bookmark_manager_button shows modal with url containing state_id when clicked", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -56,6 +49,7 @@ testthat::test_that("bookmark_manager_button shows modal with url containing sta testthat::expect_match( rvest::html_text(app$get_html_rvest("div[id$=bookmark_modal] pre")), - "_state_id_" + "_state_id_=[a-zA-Z0-9]+", # bookmark link has `_state_id_=` ) + app$stop() }) diff --git a/tests/testthat/test-shinytest2-modules.R b/tests/testthat/test-shinytest2-modules.R index 029b713fd9..516a13d577 100644 --- a/tests/testthat/test-shinytest2-modules.R +++ b/tests/testthat/test-shinytest2-modules.R @@ -2,7 +2,6 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: the module server logic is only triggered when the teal module becomes active", { - testthat::skip("chromium") skip_if_too_deep(5) value_export_module <- function(label = "custom module") { module( @@ -42,7 +41,6 @@ testthat::test_that("e2e: the module server logic is only triggered when the tea testthat::test_that("e2e: filter panel only shows the data supplied using datanames", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -59,7 +57,6 @@ testthat::test_that("e2e: filter panel only shows the data supplied using datana }) testthat::test_that("e2e: filter panel shows all the datasets when datanames is all", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -68,16 +65,12 @@ testthat::test_that("e2e: filter panel shows all the datasets when datanames is ) ) - testthat::expect_identical( - app$get_active_filter_vars(), - c("iris", "mtcars") - ) + testthat::expect_identical(app$get_active_filter_vars(), c("iris", "mtcars")) app$stop() }) -testthat::test_that("e2e: all the nested teal modules are initiated as expected", { - testthat::skip("chromium") +testthat::test_that("e2e: nested modules layout in navigation respect order and keeps group names", { skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -85,22 +78,29 @@ testthat::test_that("e2e: all the nested teal modules are initiated as expected" example_module(label = "Example Module"), modules( label = "Nested Modules", - example_module(label = "Nested 1"), - example_module(label = "Nested 2"), + example_module(label = "Nested 1.1"), + example_module(label = "Nested 1.2"), modules( label = "Sub Nested Modules", - example_module(label = "Nested 1"), - example_module(label = "Nested 1") + example_module(label = "Nested 2.1"), + example_module(label = "Nested 2.2") ) ) ) ) - app_modules <- app$get_text(selector = "ul.shiny-bound-input li a") + app_modules <- app$get_text( + selector = sprintf("ul.teal-modules-tree li %s", c("a", "span.module-group-label")) + ) testthat::expect_identical( app_modules, c( - "Example Module", "Nested Modules", "Nested 1", "Nested 2", - "Sub Nested Modules", "Nested 1", "Nested 1" + "Example Module", # Depth: 1 + "Nested Modules", # Depth: 1 + "Nested 1.1", # Depth: 2 + "Nested 1.2", # Depth: 2 + "Sub Nested Modules", # Depth: 2 + "Nested 2.1", # Depth: 3 + "Nested 2.2" # Depth: 3 ) ) app$stop() diff --git a/tests/testthat/test-shinytest2-reporter.R b/tests/testthat/test-shinytest2-reporter.R index 1489468dcd..6c88aeac5a 100644 --- a/tests/testthat/test-shinytest2-reporter.R +++ b/tests/testthat/test-shinytest2-reporter.R @@ -2,60 +2,48 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: reporter tab is created when a module has reporter", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), modules = report_module(label = "Module with Reporter") ) - teal_tabs <- rvest::html_elements(app$get_html_rvest(selector = "#teal-teal_modules-active_tab"), "a") - tab_names <- setNames( - rvest::html_attr(teal_tabs, "data-value"), - rvest::html_text(teal_tabs) + teal_tabs <- rvest::html_elements( + app$get_html_rvest(selector = "#teal-teal_modules-active_module_id .dropdown-menu"), + "a" ) testthat::expect_identical( - tab_names, - c("Module with Reporter" = "module_with_reporter", "Report previewer" = "report_previewer") + rvest::html_text(teal_tabs), + c("Module with Reporter", "Report previewer") ) app$stop() }) testthat::test_that("e2e: reporter tab is not created when a module has no reporter", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), modules = example_module(label = "Example Module") ) teal_tabs <- rvest::html_elements( - app$get_html_rvest(selector = "#teal-teal_modules-active_tab"), + app$get_html_rvest(selector = "#teal-teal_modules-active_module_id .dropdown-menu"), "a" ) - tab_names <- setNames( - rvest::html_attr(teal_tabs, "data-value"), - rvest::html_text(teal_tabs) - ) - - testthat::expect_identical( - tab_names, - c("Example Module" = "example_module") - ) + testthat::expect_identical(rvest::html_text(teal_tabs), "Example Module") app$stop() }) testthat::test_that("e2e: adding a report card in a module adds it in the report previewer tab", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), modules = report_module(label = "Module with Reporter") ) + # Add new card with label and comment app$click(NS(app$active_module_ns(), "reporter-add_report_card_simple-add_report_card_button")) - app$set_input( NS(app$active_module_ns(), "reporter-add_report_card_simple-label"), "Card name" @@ -64,30 +52,20 @@ testthat::test_that("e2e: adding a report card in a module adds it in the report NS(app$active_module_ns(), "reporter-add_report_card_simple-comment"), "Card comment" ) - app$click(NS(app$active_module_ns(), "reporter-add_report_card_simple-add_card_ok")) + # Check whether card was added app$navigate_teal_tab("Report previewer") + accordion_selector <- sprintf("#%s-pcards .accordion-toggle", app$active_module_ns()) + app$click(selector = accordion_selector) - accordian_selector <- sprintf("#%s-pcards .accordion-toggle", app$active_module_ns()) - app$click(selector = accordian_selector) - - - testthat::expect_match( - app$get_text(selector = accordian_selector), - "Card 1: Card name" - ) - - testthat::expect_match( - app$get_text(selector = "#card1 pre"), - "Card comment" - ) + testthat::expect_match(app$get_text(selector = accordion_selector), "Card 1: Card name") + testthat::expect_match(app$get_text(selector = "#card1 pre"), "Card comment") app$stop() }) testthat::test_that("e2e: reporter_previewer_module do not show data_summary nor filter_panel", { - testthat::skip("chromium") skip_if_too_deep(5) app <- teal:::TealAppDriver$new( data = simple_teal_data(), @@ -97,7 +75,6 @@ testthat::test_that("e2e: reporter_previewer_module do not show data_summary nor app$navigate_teal_tab("Report previewer") testthat::expect_null(app$is_visible(app$active_data_summary_element("table"))) - testthat::expect_null(app$get_active_filter_vars()) app$stop() diff --git a/tests/testthat/test-shinytest2-show-rcode.R b/tests/testthat/test-shinytest2-show-rcode.R index 86940ea0ed..4dd23e68e7 100644 --- a/tests/testthat/test-shinytest2-show-rcode.R +++ b/tests/testthat/test-shinytest2-show-rcode.R @@ -1,61 +1,78 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") -testthat::test_that("e2e: teal app initializes with Show R Code modal", { - testthat::skip("chromium") +testthat::describe("e2e: Module with 'Show R Code'", { skip_if_too_deep(5) - app <- TealAppDriver$new( - data = simple_teal_data(), - modules = example_module(label = "Example Module") - ) - - # Check if button exists. - button_selector <- app$active_module_element("rcode-button") - testthat::expect_equal( - app$get_text(button_selector), - "Show R code" - ) - - app$click(selector = button_selector) - - # Check header and title content. - testthat::expect_equal( - app$get_text("#shiny-modal div.modal-header > h4"), - "Example Code" - ) - - # There are two Dismiss buttons with similar id and the same label. - testthat::expect_setequal( - testthat::expect_length( - app$get_text("#shiny-modal button[data-dismiss]"), - 2 - ), - "Dismiss" - ) - # Check for Copy buttons. - testthat::expect_equal( - app$get_text(app$active_module_element("rcode-copy_button1")), - "Copy to Clipboard" - ) - testthat::expect_equal( - app$get_text(app$active_module_element("rcode-copy_button2")), - "Copy to Clipboard" - ) - - # Check R code output. - testthat::expect_setequal( - strsplit(app$get_text(app$active_module_element("rcode-verbatim_content")), "\n")[[1]], - c( - "iris <- iris", - "mtcars <- mtcars", - sprintf('stopifnot(rlang::hash(iris) == "%s") # @linksto iris', rlang::hash(iris)), - sprintf('stopifnot(rlang::hash(mtcars) == "%s") # @linksto mtcars', rlang::hash(mtcars)), - ".raw_data <- list2env(list(iris = iris, mtcars = mtcars))", - "lockEnvironment(.raw_data) # @linksto .raw_data", - "object <- iris", - "object" - ) - ) - - app$stop() + + it("initializes with visible button", { + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module") + ) + + # Check if button exists. + testthat::expect_identical( + app$get_text(app$active_module_element("rcode-button")), + "Show R code" + ) + app$stop() + }) + + it("has modal with dismiss and copy to clipboard buttons", { + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module") + ) + + app$click(selector = app$active_module_element("rcode-button")) + + # Check header and title content. + testthat::expect_equal( + app$get_text("#shiny-modal div.modal-header > h4"), + "Example Code" + ) + + # There are two Dismiss buttons with similar id and the same label. + dismiss_text <- app$get_text("#shiny-modal button[data-dismiss]") + testthat::expect_length(dismiss_text, 2) + testthat::expect_setequal(dismiss_text, "Dismiss") + + # Check for Copy buttons. + testthat::expect_equal( + app$get_text(app$active_module_element("rcode-copy_button1")), + "Copy to Clipboard" + ) + testthat::expect_equal( + app$get_text(app$active_module_element("rcode-copy_button2")), + "Copy to Clipboard" + ) + + app$stop() + }) + + it("has code", { + app <- TealAppDriver$new( + data = simple_teal_data(), + modules = example_module(label = "Example Module") + ) + + app$click(selector = app$active_module_element("rcode-button")) + + # Check R code output. + testthat::expect_identical( + strsplit(app$get_text(app$active_module_element("rcode-verbatim_content")), "\n")[[1]], + c( + "iris <- iris", + "mtcars <- mtcars", + sprintf('stopifnot(rlang::hash(iris) == "%s") # @linksto iris', rlang::hash(iris)), + sprintf('stopifnot(rlang::hash(mtcars) == "%s") # @linksto mtcars', rlang::hash(mtcars)), + ".raw_data <- list2env(list(iris = iris, mtcars = mtcars))", + "lockEnvironment(.raw_data) # @linksto .raw_data", + "object <- iris", + "object" + ) + ) + + app$stop() + }) }) diff --git a/tests/testthat/test-shinytest2-teal_data_module.R b/tests/testthat/test-shinytest2-teal_data_module.R index 3cecac24c8..cc41694b7f 100644 --- a/tests/testthat/test-shinytest2-teal_data_module.R +++ b/tests/testthat/test-shinytest2-teal_data_module.R @@ -1,149 +1,91 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") -testthat::test_that("e2e: teal_data_module auto resolves when `once=TRUE` and data is passed", { - testthat::skip("chromium") - skip_if_too_deep(5) - tdm <- teal_data_module( +example_teal_data_module <- function(with_submit = FALSE, once = TRUE) { + teal_data_module( ui = function(id) { - numericInput(NS(id, "iris_rows"), "iris rows", min = 0, max = 150, step = 1, value = 10) + tagList( + numericInput(NS(id, "iris_rows"), "iris rows", min = 0, max = 150, step = 1, value = 10), + if (with_submit) actionButton(NS(id, "submit"), "Submit") + ) }, server = function(id, ...) { moduleServer(id, function(input, output, session) { - reactive( - teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars) - ) + if (with_submit) { + eventReactive(input$submit, { + teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars) + }) + } else { + reactive(teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars)) + } }) }, - once = TRUE + once = once ) +} +testthat::test_that("e2e: teal_data_module auto resolves when `once=TRUE` and data is passed", { + skip_if_too_deep(5) app <- TealAppDriver$new( - data = tdm, + data = example_teal_data_module(with_submit = FALSE, once = TRUE), modules = example_module(label = "Example Module") ) - testthat::expect_true(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + testthat::expect_null(app$get_html(".teal-data-module-popup")) app$stop() }) testthat::test_that("e2e: teal_data_module only resolves when `once=TRUE` and data is passed", { - testthat::skip("chromium") skip_if_too_deep(5) - tdm <- teal_data_module( - ui = function(id) { - tagList( - numericInput(NS(id, "iris_rows"), "iris rows", min = 0, max = 150, step = 1, value = 10), - actionButton(NS(id, "submit"), "Submit") - ) - }, - server = function(id, ...) { - moduleServer(id, function(input, output, session) { - eventReactive(input$submit, { - teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars) - }) - }) - }, - once = TRUE - ) - app <- TealAppDriver$new( - data = tdm, + data = example_teal_data_module(with_submit = TRUE, once = TRUE), modules = example_module(label = "Example Module") ) - - testthat::expect_false(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + testthat::expect_type(app$get_html(".teal-data-module-popup"), "character") app$click("teal-data-teal_data_module-submit") - testthat::expect_true(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + testthat::expect_null(app$get_html(".teal-data-module-popup")) app$stop() }) testthat::test_that("e2e: teal_data_module modal is still open when `once=FALSE` and data is passed", { - testthat::skip("chromium") skip_if_too_deep(5) - tdm <- teal_data_module( - ui = function(id) { - numericInput(NS(id, "iris_rows"), "iris rows", min = 0, max = 150, step = 1, value = 10) - }, - server = function(id, ...) { - moduleServer(id, function(input, output, session) { - reactive( - teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars) - ) - }) - }, - once = FALSE - ) - app <- TealAppDriver$new( - data = tdm, + data = example_teal_data_module(with_submit = FALSE, once = FALSE), modules = example_module(label = "Example Module") ) - testthat::expect_false(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + testthat::expect_type(app$get_html(".teal-data-module-popup"), "character") app$click(selector = "#teal-close_teal_data_module_modal button") - testthat::expect_true(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + testthat::expect_null(app$get_html(".teal-data-module-popup"), "character") app$stop() }) testthat::test_that("e2e: teal_data_module modal close is disabled `once=FALSE` and data is passed", { - testthat::skip("chromium") skip_if_too_deep(5) - tdm <- teal_data_module( - ui = function(id) { - tagList( - numericInput(NS(id, "iris_rows"), "iris rows", min = 0, max = 150, step = 1, value = 10), - actionButton(NS(id, "submit"), "Submit") - ) - }, - server = function(id, ...) { - moduleServer(id, function(input, output, session) { - eventReactive(input$submit, { - teal_data(iris = head(iris, input$iris_rows), mtcars = mtcars) - }) - }) - }, - once = FALSE - ) - app <- TealAppDriver$new( - data = tdm, + data = example_teal_data_module(with_submit = TRUE, once = FALSE), modules = example_module(label = "Example Module") ) - testthat::expect_false( - app$get_js("document.querySelector('#teal-close_teal_data_module_modal button.disabled') === null") - ) + expected_button_selector <- "#teal-close_teal_data_module_modal button.disabled" + testthat::expect_type(app$get_html(expected_button_selector), "character") app$click("teal-data-teal_data_module-submit") app$click(selector = "#teal-close_teal_data_module_modal button") - testthat::expect_true( - app$get_js("document.querySelector('#teal-close_teal_data_module_modal button.disabled') === null") - ) - testthat::expect_true(app$get_js("document.querySelector('.teal-data-module-popup') === null")) + + testthat::expect_null(app$get_html(expected_button_selector)) app$stop() }) -testthat::test_that("e2e: teal_data_module will have a delayed load of datasets", { - testthat::skip("chromium") +testthat::test_that("e2e: datasets from teal_data_module show in filter panel", { skip_if_too_deep(5) tdm <- teal_data_module( - ui = function(id) { - ns <- shiny::NS(id) - shiny::actionButton(ns("submit"), label = "Load data") - }, + ui = function(id) shiny::actionButton(shiny::NS(id, "submit"), label = "Load data"), server = function(id) { shiny::moduleServer(id, function(input, output, session) { - shiny::eventReactive(input$submit, { - data <- within( - teal_data(), - { - dataset1 <- iris - dataset2 <- mtcars - } - ) - - data - }) + shiny::eventReactive(input$submit, within(teal_data(), { + dataset1 <- iris + dataset2 <- mtcars + })) }) } ) @@ -161,14 +103,12 @@ testthat::test_that("e2e: teal_data_module will have a delayed load of datasets" }) testthat::test_that("e2e: teal_data_module shows validation errors", { - testthat::skip("chromium") skip_if_too_deep(5) tdm <- teal_data_module( ui = function(id) { - ns <- shiny::NS(id) shiny::tagList( - shiny::textInput(ns("new_column"), label = "New column name"), - shiny::actionButton(ns("submit"), label = "Load data") + shiny::textInput(shiny::NS(id, "new_column"), label = "New column name"), + shiny::actionButton(shiny::NS(id, "submit"), label = "Load data") ) }, server = function(id) { @@ -177,8 +117,7 @@ testthat::test_that("e2e: teal_data_module shows validation errors", { shiny::validate( shiny::need(input$new_column, "Please provide a new column name") ) - data <- within(teal_data(), dataset1 <- iris) - data + within(teal_data(), dataset1 <- iris) }) }) } @@ -190,21 +129,18 @@ testthat::test_that("e2e: teal_data_module shows validation errors", { ) app$click("teal-data-teal_data_module-submit") - app$expect_validation_error() app$stop() }) testthat::test_that("e2e: teal_data_module inputs change teal_data object that is passed to teal main UI", { - testthat::skip("chromium") skip_if_too_deep(5) tdm <- teal_data_module( ui = function(id) { - ns <- shiny::NS(id) shiny::tagList( - shiny::textInput(ns("new_column"), label = "New column name"), - shiny::actionButton(ns("submit"), label = "Load data") + shiny::textInput(shiny::NS(id, "new_column"), label = "New column name"), + shiny::actionButton(shiny::NS(id, "submit"), label = "Load data") ) }, server = function(id) { @@ -213,7 +149,7 @@ testthat::test_that("e2e: teal_data_module inputs change teal_data object that i shiny::validate( shiny::need(input$new_column, "Please provide a new column name") ) - data <- within( + within( teal_data(), { dataset1 <- iris @@ -221,8 +157,6 @@ testthat::test_that("e2e: teal_data_module inputs change teal_data object that i }, new_column = input$new_column ) - - data }) }) } @@ -249,25 +183,16 @@ testthat::test_that("e2e: teal_data_module inputs change teal_data object that i }) testthat::test_that("e2e: teal_data_module gets removed after successful data load, when once = TRUE", { - testthat::skip("chromium") skip_if_too_deep(5) tdm <- teal_data_module( - ui = function(id) { - ns <- shiny::NS(id) - shiny::actionButton(ns("submit"), label = "Load data") - }, + ui = function(id) shiny::actionButton(shiny::NS(id, "submit"), label = "Load data"), server = function(id) { shiny::moduleServer(id, function(input, output, session) { shiny::eventReactive(input$submit, { - data <- within( - teal_data(), - { - dataset1 <- iris - dataset2 <- mtcars - } - ) - - data + data <- within(teal_data(), { + dataset1 <- iris + dataset2 <- mtcars + }) }) }) }, @@ -282,37 +207,23 @@ testthat::test_that("e2e: teal_data_module gets removed after successful data lo submit <- "teal-data-teal_data_module-submit" app$click(submit) - testthat::expect_null( - app$get_html('#teal-teal_modules-active_tab a[data-value="teal_data_module"]') - ) - - testthat::expect_null( - app$is_visible(sprintf("#%s", submit)) - ) + testthat::expect_null(app$get_html("#teal-open_teal_data_module_ui")) + testthat::expect_null(app$is_visible(sprintf("#%s", submit))) app$stop() }) testthat::test_that("e2e: teal_data_module is still visible after successful data load, when once = FALSE", { - testthat::skip("chromium") skip_if_too_deep(5) tdm <- teal_data_module( - ui = function(id) { - ns <- shiny::NS(id) - shiny::actionButton(ns("submit"), label = "Load data") - }, + ui = function(id) shiny::actionButton(shiny::NS(id, "submit"), label = "Load data"), server = function(id) { shiny::moduleServer(id, function(input, output, session) { shiny::eventReactive(input$submit, { - data <- within( - teal_data(), - { - dataset1 <- iris - dataset2 <- mtcars - } - ) - - data + within(teal_data(), { + dataset1 <- iris + dataset2 <- mtcars + }) }) }) }, @@ -325,74 +236,8 @@ testthat::test_that("e2e: teal_data_module is still visible after successful dat ) app$click("teal-data-teal_data_module-submit") - - testthat::expect_true( - app$is_visible('#teal-teal_modules-active_tab a[data-value="teal_data_module"]') - ) - - app$stop() -}) - -testthat::test_that("e2e: teal_data_module will make other tabs inactive before successful data load", { - testthat::skip("chromium") - skip_if_too_deep(5) - tdm <- teal_data_module( - ui = function(id) { - ns <- shiny::NS(id) - shiny::actionButton(ns("submit"), label = "Load data") - }, - server = function(id) { - shiny::moduleServer(id, function(input, output, session) { - shiny::eventReactive(input$submit, { - data <- within( - teal_data(), - { - dataset1 <- iris - dataset2 <- mtcars - } - ) - - data - }) - }) - }, - once = FALSE - ) - - app <- TealAppDriver$new( - data = tdm, - modules = modules( - example_module(label = "Example Module 1"), - example_module(label = "Example Module 2") - ) - ) - - testthat::expect_equal( - rvest::html_attr( - rvest::html_nodes( - app$get_html_rvest("#teal-teal_modules-active_tab"), - "a[data-value*='example_module']" - ), - "disabled" - ), - c("disabled", "disabled") - ) - - app$click("teal-data-teal_data_module-submit") - - testthat::expect_true( - is.na( - unique( - rvest::html_attr( - rvest::html_nodes( - app$get_html_rvest("#teal-teal_modules-active_tab"), - "a[data-value*='example_module']" - ), - "disabled" - ) - ) - ) - ) + app$click(selector = "#teal-close_teal_data_module_modal button") + testthat::expect_true(app$is_visible("#teal-open_teal_data_module_ui")) app$stop() }) diff --git a/tests/testthat/test-shinytest2-teal_slices.R b/tests/testthat/test-shinytest2-teal_slices.R index 189583db35..5461298ae0 100644 --- a/tests/testthat/test-shinytest2-teal_slices.R +++ b/tests/testthat/test-shinytest2-teal_slices.R @@ -2,7 +2,6 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") testthat::test_that("e2e: teal_slices filters are initialized when global filters are created", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -46,7 +45,6 @@ testthat::test_that("e2e: teal_slices filters are initialized when global filter }) testthat::test_that("e2e: teal_slices filters are initialized when module specific filters are created", { - testthat::skip("chromium") skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), diff --git a/tests/testthat/test-shinytest2-wunder_bar.R b/tests/testthat/test-shinytest2-wunder_bar.R index f0d955c3a6..2427084ac5 100644 --- a/tests/testthat/test-shinytest2-wunder_bar.R +++ b/tests/testthat/test-shinytest2-wunder_bar.R @@ -1,8 +1,7 @@ testthat::skip_if_not_installed("shinytest2") testthat::skip_if_not_installed("rvest") -testthat::test_that("wunder_bar_srv clicking filter icon opens filter-manager modal", { - testthat::skip("chromium") +testthat::test_that("e2e: wunder_bar_srv clicking filter icon opens filter-manager modal", { skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -15,14 +14,13 @@ testthat::test_that("wunder_bar_srv clicking filter icon opens filter-manager mo value = TRUE ) - testthat::expect_true(is.null(app$get_text(".teal-filter-manager-modal"))) + testthat::expect_null(app$get_text(".teal-filter-manager-modal")) app$click(filter_manager_btn_id) - testthat::expect_true(!is.null(app$get_text(".teal-filter-manager-modal"))) + testthat::expect_type(app$get_text(".teal-filter-manager-modal"), "character") }) -testthat::test_that("wunder_bar_srv clicking snapshot icon opens snapshot-manager modal", { - testthat::skip("chromium") +testthat::test_that("e2e: wunder_bar_srv clicking snapshot icon opens snapshot-manager modal", { skip_if_too_deep(5) app <- TealAppDriver$new( data = simple_teal_data(), @@ -35,7 +33,40 @@ testthat::test_that("wunder_bar_srv clicking snapshot icon opens snapshot-manage value = TRUE ) - testthat::expect_true(is.null(app$get_text(".snapshot_manager_modal"))) + testthat::expect_null(app$get_text(".snapshot_manager_modal")) app$click(snapshot_manager_btn_id) - testthat::expect_true(!is.null(app$get_text(".snapshot_manager_modal"))) + testthat::expect_type(app$get_text(".snapshot_manager_modal"), "character") +}) + +testthat::test_that("e2e: initial wunderbar shows filter and data summary", { + skip_if_too_deep(5) + + data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) + app <- TealAppDriver$new(data = data, modules = example_module()) + testthat::expect_true(app$is_visible(".teal-filter-panel")) + testthat::expect_true(app$is_visible(".teal-active-data-summary-panel")) + app$stop() +}) + +testthat::test_that("e2e: collapsing wunderbar hides filter and data summary", { + skip_if_too_deep(5) + + data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) + app <- TealAppDriver$new(data = data, modules = example_module()) + app$click(selector = ".teal_module.active > .bslib-sidebar-layout > button.collapse-toggle") + testthat::expect_false(app$is_visible(".teal-filter-panel")) + testthat::expect_false(app$is_visible(".teal-active-data-summary-panel")) + app$expect_screenshot(selector = ".bslib-sidebar-layout .main") + app$stop() +}) + +testthat::test_that("e2e: wunderbar filter and data summary are hidden on narrow windows", { + skip_if_too_deep(5) + + data <- teal.data::teal_data(mtcars1 = mtcars, mtcars2 = data.frame(am = c(0, 1), test = c("a", "b"))) + app <- TealAppDriver$new(data = data, modules = example_module(), width = 300, height = 1080) + testthat::expect_false(app$is_visible(".teal-filter-panel")) + testthat::expect_false(app$is_visible(".teal-active-data-summary-panel")) + + app$stop() })