diff --git a/DESCRIPTION b/DESCRIPTION index 287d955d..0888ada8 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -48,7 +48,8 @@ Suggests: testthat (>= 3.1.5), withr (>= 2.1.0) VignetteBuilder: - knitr + knitr, + rmarkdown Config/Needs/verdepcheck: rstudio/bslib, mllg/checkmate, tidyverse/ggplot2, rstudio/htmltools, r-lib/lifecycle, insightsengineering/rtables, rstudio/shiny, daattali/shinyjs, diff --git a/R/get_dt_rows.R b/R/get_dt_rows.R index 4e3d99f0..b90cc5be 100644 --- a/R/get_dt_rows.R +++ b/R/get_dt_rows.R @@ -9,7 +9,7 @@ #' #' @return (`shiny::tagList`) A `shiny tagList`. #' -#' @examples +#' @examplesIf require("DT") #' library(shiny) #' library(DT) #' diff --git a/man/get_dt_rows.Rd b/man/get_dt_rows.Rd index 36ee4b96..e9367828 100644 --- a/man/get_dt_rows.Rd +++ b/man/get_dt_rows.Rd @@ -19,6 +19,7 @@ get_dt_rows(dt_name, dt_rows) Maps the \code{lengthMenu} selected value property of \code{DT::datatable} to a \code{shiny} variable. } \examples{ +\dontshow{if (require("DT")) (if (getRversion() >= "3.4") withAutoprint else force)(\{ # examplesIf} library(shiny) library(DT) @@ -48,4 +49,5 @@ if (interactive()) { server = function(input, output, session) server("my_table_module") ) } +\dontshow{\}) # examplesIf} } diff --git a/tests/testthat/test-plot_with_settings.R b/tests/testthat/test-plot_with_settings.R index bc572ff0..70a0a178 100644 --- a/tests/testthat/test-plot_with_settings.R +++ b/tests/testthat/test-plot_with_settings.R @@ -233,6 +233,8 @@ testthat::test_that("type_download_srv download all types of files and change th }) testthat::test_that("type_download_srv downloads a png file with different dimensions", { + testthat::skip_if_not_installed("png") + shiny::testServer( teal.widgets:::type_download_srv, args = download_srv_args, @@ -248,6 +250,8 @@ testthat::test_that("type_download_srv downloads a png file with different dimen }) testthat::test_that("type_download_srv downloads a png file using default dimensions input dimensions are NULL", { + testthat::skip_if_not_installed("png") + shiny::testServer( teal.widgets:::type_download_srv, args = list( @@ -309,6 +313,8 @@ plot_with_settings_args <- list( ) testthat::test_that("plot_with_settings_srv set dimensions and download a png file - base", { + testthat::skip_if_not_installed("png") + plot_with_settings_args$plot_r <- function() plot(1) shiny::testServer( teal.widgets:::plot_with_settings_srv, @@ -331,6 +337,8 @@ testthat::test_that("plot_with_settings_srv set dimensions and download a png fi }) testthat::test_that("plot_with_settings_srv set dimensions and download a png file - ggplot2", { + testthat::skip_if_not_installed("png") + plot_with_settings_args$plot_r <- function() { ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) + ggplot2::geom_line() @@ -356,6 +364,8 @@ testthat::test_that("plot_with_settings_srv set dimensions and download a png fi }) testthat::test_that("plot_with_settings_srv set dimensions and download a png file - grob", { + testthat::skip_if_not_installed("png") + plot_with_settings_args$plot_r <- function() { ggplot2::ggplotGrob( ggplot2::ggplot(mtcars, ggplot2::aes(mpg, wt)) + @@ -383,6 +393,8 @@ testthat::test_that("plot_with_settings_srv set dimensions and download a png fi }) testthat::test_that("plot_with_settings_srv set dimensions and download a png file - trellis", { + testthat::skip_if_not_installed("png") + plot_with_settings_args$plot_r <- function() { lattice::densityplot(1) } @@ -407,6 +419,8 @@ testthat::test_that("plot_with_settings_srv set dimensions and download a png fi }) testthat::test_that("plot_with_settings_srv set dimensions and download a png file - WRONG type", { + testthat::skip_if_not_installed("png") + plot_with_settings_args$plot_r <- function() 2 shiny::testServer( @@ -442,6 +456,8 @@ testthat::test_that("plot_with_settings_srv expand no error", { }) testthat::test_that("plot_with_settings_srv set dimensions and download a png file from modal", { + testthat::skip_if_not_installed("png") + plot_with_settings_args[["plot_r"]] <- function() plot(1) shiny::testServer( teal.widgets:::plot_with_settings_srv,