Skip to content

Commit 6e1f979

Browse files
Added test to check whether the fix works or not.
1 parent c89d84f commit 6e1f979

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

tests/testthat/test-ggplot-color.R

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
df = data.frame(width = 1:3, height = 1:3, col = letters[1:3])
2+
test_that("ggplotly automatically converts `color` aes to `colour`", {
3+
ggpenguins <- qplot(width, height,
4+
data = df, color = col)
5+
# color variable is not shown
6+
color <- plotly_build(ggplotly(ggpenguins, tooltip = c("color")))
7+
# colour (with u!) variable is shown
8+
expect_identical(color$x$data, plotly_build(ggplotly(ggpenguins, tooltip = c("colour")))$x$data)
9+
})
10+

0 commit comments

Comments
 (0)