We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 6b680a4 commit c5ee8b8Copy full SHA for c5ee8b8
tests/testthat/test-scale_date.R
@@ -1,4 +1,19 @@
1
2
+test_that("date(time) scales coerce data types", {
3
+
4
+ date <- as.Date("2024-11-11")
5
+ datetime <- as.POSIXct(date)
6
7
+ sc <- scale_x_datetime()
8
+ df <- sc$transform_df(data.frame(x = date))
9
+ expect_equal(df$x, as.numeric(datetime))
10
11
+ sc <- scale_x_date()
12
+ df <- sc$transform_df(data.frame(x = datetime))
13
+ expect_equal(df$x, as.numeric(date))
14
15
+})
16
17
# Visual tests ------------------------------------------------------------
18
19
test_that("date scale draws correctly", {
0 commit comments