Skip to content

Commit

Permalink
Merge branch 'main' into propagations-august-2024
Browse files Browse the repository at this point in the history
  • Loading branch information
m7pr authored Aug 5, 2024
2 parents ddafdd8 + ac6869e commit 2fdbc75
Show file tree
Hide file tree
Showing 19 changed files with 71 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ default_language_version:
python: python3
repos:
- repo: https://github.com/lorenzwalthert/precommit
rev: v0.4.2
rev: v0.4.3
hooks:
- id: style-files
name: Style code with `styler`
Expand Down
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Type: Package
Package: teal
Title: Exploratory Web Apps for Analyzing Clinical Trials Data
Version: 0.15.2.9047
Date: 2024-07-03
Version: 0.15.2.9048
Date: 2024-08-05
Authors@R: c(
person("Dawid", "Kaledkowski", , "[email protected]", role = c("aut", "cre"),
comment = c(ORCID = "0000-0001-9533-457X")),
Expand Down
2 changes: 1 addition & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# teal 0.15.2.9047
# teal 0.15.2.9048

### Enhancement
* Provided progress bar for modules loading and data filtering during teal app startup.
Expand Down
10 changes: 9 additions & 1 deletion R/TealAppDriver.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,15 @@
#'
TealAppDriver <- R6::R6Class( # nolint: object_name.
"TealAppDriver",
inherit = shinytest2::AppDriver,
inherit = {
if (!requireNamespace("shinytest2", quietly = TRUE)) {
stop("Please install 'shinytest2' package to use this class.")
}
if (!requireNamespace("rvest", quietly = TRUE)) {
stop("Please install 'rvest' package to use this class.")
}
shinytest2::AppDriver
},
# public methods ----
public = list(
#' @description
Expand Down
2 changes: 1 addition & 1 deletion R/validate_inputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
#'
#' @seealso [`shinyvalidate::InputValidator`], [`shiny::validate`]
#'
#' @examples
#' @examplesIf require("shinyvalidate")
#' library(shiny)
#' library(shinyvalidate)
#'
Expand Down
3 changes: 2 additions & 1 deletion man/validate_inputs.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 0 additions & 3 deletions tests/testthat/helper-shinytest2.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
library(shinytest2)
library(rvest)

simple_teal_data <- function() {
data <- within(teal_data(), {
iris <- iris
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-filter_panel.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("e2e: module content is updated when a data is filtered in filter panel", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-init.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("e2e: teal app initializes with no errors", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-landing_popup.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-module_bookmark_manager.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("bookmark_manager_button is not rendered by default", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-modules.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,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", {
skip_if_too_deep(5)
value_export_module <- function(label = "custom module") {
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-reporter.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-show-rcode.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("e2e: teal app initializes with Show R Code modal", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-teal_data_module.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("e2e: teal_data_module will have a delayed load of datasets", {
skip_if_too_deep(5)
tdm <- teal_data_module(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-teal_slices.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,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", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-utils.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
testthat::skip_if_not_installed("shinytest2")
testthat::skip_if_not_installed("rvest")

testthat::test_that("e2e: show/hide hamburger works as expected", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
3 changes: 3 additions & 0 deletions tests/testthat/test-shinytest2-wunder_bar.R
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
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", {
skip_if_too_deep(5)
app <- TealAppDriver$new(
Expand Down
22 changes: 22 additions & 0 deletions tests/testthat/test-validate_inputs.R
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ testthat::test_that("invalid arguments raise errors", {


testthat::test_that("disabled validators raise warnings (individual validators)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv1 <- shinyvalidate::InputValidator$new()
iv1$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand All @@ -36,6 +38,8 @@ testthat::test_that("disabled validators raise warnings (individual validators)"


testthat::test_that("disabled validators raise warnings (validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv1 <- shinyvalidate::InputValidator$new()
iv1$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand All @@ -61,6 +65,8 @@ testthat::test_that("disabled validators raise warnings (validator list)", {


testthat::test_that("disabled validators raise warnings (nested validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv1 <- shinyvalidate::InputValidator$new()
iv1$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand All @@ -86,6 +92,8 @@ testthat::test_that("disabled validators raise warnings (nested validator list)"


testthat::test_that("valid inputs produce desired output (individual validators)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -114,6 +122,8 @@ testthat::test_that("valid inputs produce desired output (individual validators)


testthat::test_that("valid inputs produce desired output (validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -142,6 +152,8 @@ testthat::test_that("valid inputs produce desired output (validator list)", {


testthat::test_that("valid inputs produce desired output (nested validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -170,6 +182,8 @@ testthat::test_that("valid inputs produce desired output (nested validator list)


testthat::test_that("invalid inputs raise errors in output (individual validators)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -209,6 +223,8 @@ testthat::test_that("invalid inputs raise errors in output (individual validator


testthat::test_that("invalid inputs raise errors in output (validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -247,6 +263,8 @@ testthat::test_that("invalid inputs raise errors in output (validator list)", {
})

testthat::test_that("invalid inputs raise errors in output (nested validator list)", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -286,6 +304,8 @@ testthat::test_that("invalid inputs raise errors in output (nested validator lis


testthat::test_that("error message is formatted properly", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down Expand Up @@ -483,6 +503,8 @@ testthat::test_that("error message is formatted properly", {


testthat::test_that("different validation modes produce proper messages", {
testthat::skip_if_not_installed("shinyvalidate")

server <- function(input, output, session) {
iv <- shinyvalidate::InputValidator$new()
iv$add_rule("letter", shinyvalidate::sv_in_set(LETTERS, "choose a capital letter"))
Expand Down

0 comments on commit 2fdbc75

Please sign in to comment.