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 adcd2cb commit a98d9e2Copy full SHA for a98d9e2
tests/testthat/test-scale-date.R
@@ -47,6 +47,19 @@ test_that("not cached across calls", {
47
expect_equal(get_panel_scales(p2)$x$timezone, "Australia/Lord_Howe")
48
})
49
50
+test_that("time scale date breaks and labels work", {
51
+
52
+ d <- c(base_time(), base_time() + 5 * 24 * 3600) - base_time()
53
54
+ sc <- scale_x_time(date_breaks = "1 day", date_labels = "%d")
55
+ sc$train(d)
56
57
+ breaks <- sc$get_breaks()
58
+ expect_length(breaks, 6)
59
+ labels <- sc$get_labels(breaks)
60
+ expect_equal(labels, paste0("0", 1:6))
61
+})
62
63
test_that("datetime size scales work", {
64
p <- ggplot(df, aes(y = y)) + geom_point(aes(time1, size = time1))
65
0 commit comments