Skip to content

Commit ce61432

Browse files
committed
Test fixes
1 parent ae0a349 commit ce61432

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

tests/testthat/test-ggplot-bar.R

+3-1
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@ test_that("dates work well with bar charts", {
6161
info <- expect_traces(gd, 2, "dates")
6262
trs <- info$traces
6363
expect_identical(info$kwargs$layout$xaxis$type, "date")
64-
expect_identical(trs[[1]]$x, unique(researchers$month))
64+
# plotly likes time in milliseconds
65+
t <- as.numeric(unique(researchers$month)) * 24 * 60 * 60 * 1000
66+
expect_identical(trs[[1]]$x, t)
6567
})
6668

6769
## http://www.cookbook-r.com/Graphs/Bar_and_line_graphs_%28ggplot2%29/

tests/testthat/test-ggplot-histogram.R

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ test_that("geom_histogram(aes(fill = ..count..)) works", {
4242
info <- expect_traces(base + geom_histogram(aes(fill = ..count..)), 6, "fill")
4343
tr <- info$traces
4444
# each traces should have the same value of y
45-
for (i in seq_along(traces)) {
45+
for (i in seq_along(tr)) {
4646
ys <- tr[[i]]$y
4747
expect_equal(length(unique(ys)), 1)
4848
}

0 commit comments

Comments
 (0)