diff --git a/R/modules.R b/R/modules.R index fc863219a9..f6d5bfcbe1 100644 --- a/R/modules.R +++ b/R/modules.R @@ -219,7 +219,7 @@ module <- function(label = "module", } if (any(c("data", "datasets") %in% ui_formals)) { - warning( + stop( sprintf("Called from module(label = \"%s\", ...)\n ", label), "UI with `data` or `datasets` argument is no longer accepted.\n ", "If some UI inputs depend on data, please move the logic to your server instead.\n ", diff --git a/tests/testthat/test-module_teal.R b/tests/testthat/test-module_teal.R index 5610fe5c60..2e91a13f57 100644 --- a/tests/testthat/test-module_teal.R +++ b/tests/testthat/test-module_teal.R @@ -921,9 +921,9 @@ testthat::describe("srv_teal teal_modules", { app = srv_teal, args = list( id = "test", - dataset = teal.data::teal_data(iris = iris, mtcars = mtcars), + data = teal.data::teal_data(iris = iris, mtcars = mtcars), modules = modules( - module("module_1", server = function(id, data) data) + module("module_1", server = function(id, datasets) datasets) ) ), expr = { diff --git a/tests/testthat/test-modules.R b/tests/testthat/test-modules.R index fde07538cd..65295a363d 100644 --- a/tests/testthat/test-modules.R +++ b/tests/testthat/test-modules.R @@ -78,8 +78,8 @@ testthat::test_that("module requires ui_args argument to be a list", { }) testthat::test_that("module throws when ui has data or datasets argument", { - testthat::expect_warning(module(ui = function(id, data) NULL)) - testthat::expect_warning(module(ui = function(id, datasets) NULL)) + testthat::expect_error(module(ui = function(id, data) NULL)) + testthat::expect_error(module(ui = function(id, datasets) NULL)) }) testthat::test_that("module expects ui being a shiny ui module with any argument", {