-
-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into propagation-march-2024
Signed-off-by: cicdguy <[email protected]>
- Loading branch information
Showing
15 changed files
with
1,043 additions
and
181 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Package: teal.widgets | ||
Title: 'shiny' Widgets for 'teal' Applications | ||
Version: 0.4.2.9009 | ||
Date: 2024-03-18 | ||
Version: 0.4.2.9010 | ||
Date: 2024-04-26 | ||
Authors@R: c( | ||
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre")), | ||
person("Pawel", "Rucki", , "[email protected]", role = "aut"), | ||
|
@@ -41,6 +41,7 @@ Suggests: | |
lattice (>= 0.18-4), | ||
magrittr (>= 1.5), | ||
png, | ||
rvest, | ||
shinytest2 (>= 0.2.0), | ||
shinyvalidate, | ||
testthat (>= 3.1.5), | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
# teal.widgets 0.4.2.9009 | ||
# teal.widgets 0.4.2.9010 | ||
|
||
# teal.widgets 0.4.2 | ||
|
||
|
Binary file removed
BIN
-21.6 KB
tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-download_menu.png
Binary file not shown.
Binary file removed
BIN
-6.19 KB
tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-hidden.png
Binary file not shown.
Binary file removed
BIN
-25.7 KB
tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-resize_menu.png
Binary file not shown.
Binary file removed
BIN
-11.3 KB
tests/testthat/_snaps/app_pws_ui/plot_with_settings_ui/pws-visible.png
Binary file not shown.
36 changes: 0 additions & 36 deletions
36
tests/testthat/_snaps/app_tws_ui/table_with_settings_ui/tws-final_values.json
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
#' Returns testing depth set by session option or by environmental variable. | ||
#' | ||
#' @details Looks for the session option `TESTING_DEPTH` first. | ||
#' If not set, takes the system environmental variable `TESTING_DEPTH`. | ||
#' If neither is set, then returns 3 by default. | ||
#' If the value of `TESTING_DEPTH` is not a numeric of length 1, then returns 3. | ||
#' | ||
#' @return `numeric(1)` the testing depth. | ||
#' | ||
get_testing_depth <- function() { | ||
default_depth <- 3 | ||
depth <- getOption("TESTING_DEPTH", Sys.getenv("TESTING_DEPTH", default_depth)) | ||
depth <- tryCatch( | ||
as.numeric(depth), | ||
error = function(error) default_depth, | ||
warning = function(warning) default_depth | ||
) | ||
if (length(depth) != 1) depth <- default_depth | ||
depth | ||
} | ||
|
||
#' Skipping tests in the testthat pipeline under specific scope | ||
#' @description This function should be used per each `testthat::test_that` call. | ||
#' Each of the call should specify an appropriate depth value. | ||
#' The depth value will set the appropriate scope so more/less time consuming tests could be recognized. | ||
#' The environment variable `TESTING_DEPTH` is used for changing the scope of `testthat` pipeline. | ||
#' `TESTING_DEPTH` interpretation for each possible value: | ||
#' \itemize{ | ||
#' \item{0}{no tests at all} | ||
#' \item{1}{fast - small scope - executed on every commit} | ||
#' \item{3}{medium - medium scope - daily integration pipeline} | ||
#' \item{5}{slow - all tests - daily package tests} | ||
#' } | ||
#' @param depth `numeric` the depth of the testing evaluation, | ||
#' has opposite interpretation to environment variable `TESTING_DEPTH`. | ||
#' So e.g. `0` means run it always and `5` means a heavy test which should be run rarely. | ||
#' If the `depth` argument is larger than `TESTING_DEPTH` then the test is skipped. | ||
#' @importFrom testthat skip | ||
#' @return `NULL` or invoke an error produced by `testthat::skip` | ||
#' @note By default `TESTING_DEPTH` is equal to 3 if there is no environment variable for it. | ||
#' By default `depth` argument lower or equal to 3 will not be skipped because by default `TESTING_DEPTH` | ||
#' is equal to 3. To skip <= 3 depth tests then the environment variable has to be lower than 3 respectively. | ||
skip_if_too_deep <- function(depth) { # nolintr | ||
checkmate::assert_numeric(depth, len = 1, lower = 0, upper = 5) | ||
testing_depth <- get_testing_depth() # by default 3 if there are no env variable | ||
if (testing_depth < depth) { | ||
testthat::skip(paste("testing depth", testing_depth, "is below current testing specification", depth)) | ||
} | ||
} | ||
|
||
default_idle_timeout <- 20000 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#' 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. | ||
#' @note reference to https://stackoverflow.com/questions/74615694/check-if-a-function-draw-plot-something | ||
#' @keywords internal | ||
is_draw <- function(plot_fun) { | ||
checkmate::assert_function(plot_fun) | ||
grDevices::graphics.off() # close any current graphics devices | ||
cdev <- grDevices::dev.cur() | ||
plot_fun() | ||
if (cdev != grDevices::dev.cur()) { | ||
on.exit(grDevices::dev.off()) | ||
return(TRUE) | ||
} | ||
return(FALSE) | ||
} | ||
|
||
|
||
is_visible <- function(element, app_driver) { | ||
any( | ||
unlist( | ||
app_driver$get_js( | ||
sprintf( | ||
"Array.from(document.querySelectorAll('%s')).map(el => el.checkVisibility())", | ||
element | ||
) | ||
) | ||
) | ||
) | ||
} |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.