Skip to content

Commit 11ba0e0

Browse files
committed
throw warning if cloud is specified; add tests
1 parent de622a0 commit 11ba0e0

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

R/layout.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -159,7 +159,7 @@ config <- function(p, ..., cloud = FALSE, showSendToCloud = cloud, locale = NULL
159159
args <- list(...)
160160
if ("collaborate" %in% names(args)) warning("The collaborate button is no longer supported")
161161
p$x$config <- modify_list(p$x$config, args)
162-
if (cloud) message("The `cloud` argument is deprecated. Use `showSendToCloud` instead.")
162+
if (cloud) warning("The `cloud` argument is deprecated. Use `showSendToCloud` instead.")
163163
p$x$config$showSendToCloud <- showSendToCloud
164164

165165
p

tests/testthat/test-plotly.R

+15
Original file line numberDiff line numberDiff line change
@@ -295,3 +295,18 @@ test_that("Axis domains aren't supplied if layout.grid exists", {
295295
expect_null(l$layout$xaxis$domain)
296296
expect_null(l$layout$yaxis$domain)
297297
})
298+
299+
300+
test_that("Informative deprecation message for titlefont", {
301+
expect_warning(config(plot_ly(), cloud = TRUE), "cloud")
302+
})
303+
304+
test_that("Informative warning for invalid config attr", {
305+
p <- config(plot_ly(), foobar = TRUE)
306+
expect_warning(plotly_build(p), "foobar")
307+
})
308+
309+
test_that("Informative deprecation message for titlefont", {
310+
p <- layout(plot_ly(), title = "A title", titlefont = list(size = 30))
311+
expect_warning(plotly_build(p), "titlefont")
312+
})

0 commit comments

Comments
 (0)