Skip to content

Commit

Permalink
review
Browse files Browse the repository at this point in the history
  • Loading branch information
gogonzo committed Nov 10, 2023
1 parent 8a0675f commit 422efa6
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 21 deletions.
17 changes: 0 additions & 17 deletions tests/testthat/test-init.R
Original file line number Diff line number Diff line change
Expand Up @@ -149,23 +149,6 @@ testthat::test_that("init data accepts teal_data_module", {
)
})

testthat::test_that("init teal_data_module doesn't accept ui and server with other formals than id", {
testthat::expect_error(
init(
data = teal_data_module(ui = function(id, x) div(), server = function(id) NULL),
modules = modules(teal:::example_module())
),
"Must have exactly 1 formal arguments"
)
testthat::expect_error(
init(
data = teal_data_module(ui = function(id) div(), server = function(id, x) NULL),
modules = modules(teal:::example_module())
),
"Must have exactly 1 formal arguments"
)
})

testthat::test_that("init modules accepts a teal_modules object", {
mods <- modules(example_module(), example_module())
testthat::expect_no_error(init(data = iris, modules = mods))
Expand Down
6 changes: 3 additions & 3 deletions tests/testthat/test-module_nested_tabs.R
Original file line number Diff line number Diff line change
Expand Up @@ -486,9 +486,9 @@ testthat::test_that("calculate_hashes takes a FilteredData and vector of datanam

datasets <- teal.slice::init_filtered_data(
list(
ADSL = list(dataset = head(adsl)),
ADAE = list(dataset = head(adae)),
ADTTE = list(dataset = head(adtte))
ADSL = list(dataset = adsl),
ADAE = list(dataset = adae),
ADTTE = list(dataset = adtte)
)
)

Expand Down
2 changes: 1 addition & 1 deletion tests/testthat/test-module_teal_with_splash.R
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ testthat::test_that("srv_teal_with_splash raw_data evaluates the server of teal_
)
})

testthat::test_that("srv_teal_with_splash passes teal_data to reactiveVal", {
testthat::test_that("srv_teal_with_splash passes teal_data to reactive", {
shiny::testServer(
app = srv_teal_with_splash,
args = list(
Expand Down
20 changes: 20 additions & 0 deletions tests/testthat/test-teal_data_module.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
testthat::test_that("teal_data_module returns teal_data_module", {
testthat::expect_s3_class(
teal_data_module(ui = function(id) div(), server = function(id) NULL),
"teal_data_module"
)
})

testthat::test_that("teal_data_module throws when ui has other formals than id only", {
testthat::expect_error(
teal_data_module(ui = function(id, x) div(), server = function(id) NULL),
"Must have exactly 1 formal arguments"
)
})

testthat::test_that("teal_data_module throws when server has other formals than id only", {
testthat::expect_error(
teal_data_module(ui = function(id) div(), server = function(id, x) NULL),
"Must have exactly 1 formal arguments"
)
})

0 comments on commit 422efa6

Please sign in to comment.