create_test_update_fns: Create Test Update Functions

View source: R/create_test_update_fn.R

create_test_update_fnsR Documentation

Create Test Update Functions

Description

Given a set of functions from an R package, create a set of mocked functions that can be used as bindings to test UI updates within testServer.

Usage

create_test_update_fns(
  fn_names,
  id_arg = "inputId",
  value_args = c("value", "selected"),
  range_value_args = c("start", "end"),
  .package = "shiny"
)

Arguments

fn_names

A character vector (string) of function names to create wrappers for

id_arg

A character string of the argument in 'fn_names' that relates to the HTML ID argument. Default is "inputId"

value_args

A character vector of the arguments in 'fn_names' that relate to the input value arguments. Defaults are '"value"' and '"selected'.

range_value_args

A character vector of the arguments in 'fn_names' that relate to the input value arguments when multiple arguments can be used to update the input. Defaults are '"start"' and '"end"'.

.package

Character string of the package that 'fn_names' exist in. Default is '"shiny"'

Value

A named list of function expressions, one for each function supplied in 'fn_names'.

Examples

create_test_update_fns(
  c("updateSelectInput", "updateTextInput"),
  .package = "shiny"
)


shinytesters documentation built on Sept. 1, 2025, 5:10 p.m.