diff --git a/DESCRIPTION b/DESCRIPTION index feac4b05..e70a1834 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -45,4 +45,4 @@ Encoding: UTF-8 Language: en-US LazyData: true Roxygen: list(markdown = TRUE) -RoxygenNote: 7.2.3 +RoxygenNote: 7.2.1 diff --git a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-download_menu.png b/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-download_menu.png deleted file mode 100644 index 65a6e326..00000000 Binary files a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-download_menu.png and /dev/null differ diff --git a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-hidden.png b/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-hidden.png deleted file mode 100644 index ed3ce36e..00000000 Binary files a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-hidden.png and /dev/null differ diff --git a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-resize_menu.png b/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-resize_menu.png deleted file mode 100644 index 2fbecad7..00000000 Binary files a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-resize_menu.png and /dev/null differ diff --git a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-visible.png b/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-visible.png deleted file mode 100644 index e9f15cc7..00000000 Binary files a/tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-visible.png and /dev/null differ diff --git a/tests/testthat/_snaps/app_tws_ui/table_with_settings_ui/tws-initial_view.png b/tests/testthat/_snaps/app_tws_ui/table_with_settings_ui/tws-initial_view.png deleted file mode 100644 index 5e344057..00000000 Binary files a/tests/testthat/_snaps/app_tws_ui/table_with_settings_ui/tws-initial_view.png and /dev/null differ diff --git a/tests/testthat/helpers-with-settings.R b/tests/testthat/helpers-with-settings.R index d5cc329c..26e535db 100644 --- a/tests/testthat/helpers-with-settings.R +++ b/tests/testthat/helpers-with-settings.R @@ -31,55 +31,6 @@ app_tws <- function() { ) } -#' Plot with settings app -#' -#' @description Example plot with setting app for testing using \code{shinytest2} -#' -#' @keywords internal -#' -app_pws <- function() { - shiny::shinyApp( - ui = shiny::fluidPage( - shinyjs::useShinyjs(), - shiny::actionButton("button", "Show/Hide"), - plot_with_settings_ui( - id = "plot_with_settings" - ) - ), - server = function(input, output, session) { - plot_r <- shiny::reactive({ - ggplot2::ggplot(data.frame(x = 1:5, y = 1:5)) + - ggplot2::geom_point(ggplot2::aes(x = 1:5, y = 1:5)) - }) - - show_hide_signal <- shiny::reactiveVal(TRUE) - - shiny::observeEvent(input$button, { - show_hide_signal( - !show_hide_signal() - ) - }) - - plot_data <- plot_with_settings_srv( - id = "plot_with_settings", - plot_r = plot_r, - height = c(400, 100, 1200), - width = c(500, 250, 750), - brushing = TRUE, - clicking = TRUE, - dblclicking = TRUE, - hovering = TRUE, - show_hide_signal = show_hide_signal - ) - - shiny::exportTestValues( - plot_r = plot_r, - plot_data = plot_data - ) - } - ) -} - #' Function to check if a function has a side effect of drawing something #' @param `function` function which possibly draws something. #' @return `logical(1)` whether the function has a side effect of drawing a plot. diff --git a/tests/testthat/test-plot_with_settings_ui.R b/tests/testthat/test-plot_with_settings_ui.R index 5ec845c9..43a12d91 100644 --- a/tests/testthat/test-plot_with_settings_ui.R +++ b/tests/testthat/test-plot_with_settings_ui.R @@ -6,39 +6,4 @@ testthat::test_that("plot_with_settings_ui returns shiny.tag.list", { testthat::expect_s3_class(plot_with_settings_ui("STH"), "shiny.tag.list") }) -testthat::test_that("Plot with settings: UI screenshots", { - skip_on_cran() - skip_on_ci() - app <- AppDriver$new( - app_pws(), - name = "pws", - variant = "app_pws_ui" - ) - threshold <- 60 - kernel_size <- 20 - delay <- 0.3 - - # click on hide/show button - app$click("button") - app$expect_screenshot( - threshold = threshold, kernel_size = kernel_size, delay = delay, name = "hidden" - ) - app$click("button") - app$expect_screenshot( - threshold = threshold, kernel_size = kernel_size, delay = delay, name = "visible" - ) - - app$set_inputs(`plot_with_settings-downbutton-file_name` = "plot1") - app$set_inputs(`plot_with_settings-modal_downbutton-file_name` = "plot2") - - app$click("plot_with_settings-downbutton-downl") - app$expect_screenshot( - threshold = threshold, kernel_size = kernel_size, delay = delay, name = "download_menu" - ) - app$click("plot_with_settings-expbut") - app$expect_screenshot( - threshold = threshold, kernel_size = kernel_size, delay = delay, name = "resize_menu" - ) - - app$stop() -}) +library(shinytest2)