Skip to content

Commit 990b003

Browse files
authored
Merge pull request #62 from ropensci/cran-fixes
Fix url and ignore colors in tests instead of duplicating objects
2 parents 9930f94 + 0c1d8ae commit 990b003

File tree

74 files changed

+19
-10
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

74 files changed

+19
-10
lines changed

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,4 @@
1414
^_pkgdown\.yml$
1515
^cran-comments\.md$
1616
^codemeta\.json$
17+
^CRAN-RELEASE$

R/iheatmapr.R

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
#'
1515
#' See the vignette for detailed instructions for how to use the package.
1616
#'
17-
#' iheatmapr uses the plotly javascript library (\url{plot.ly}) for making the
17+
#' iheatmapr uses the plotly javascript library (\url{https://plot.ly/}) for making the
1818
#' interactive figures and htmlwidgets (http://www.htmlwidgets.org/) for
1919
#' rendering them in R.
2020
#'

man/iheatmapr.Rd

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

tests/testthat/helper_expectation.R

Lines changed: 16 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,16 @@
1+
remove_colors <- function(x) {
2+
# Colors are problematic because a slight change in color will lead to test
3+
# failing -- this helper function removes them.
4+
x$colorscale <- x$colorscale[[1]]
5+
6+
x
7+
}
8+
9+
replace_colorscales <- function(x) {
10+
x$data <- lapply(x$data, remove_colors)
11+
x
12+
}
13+
114

215
# modified from testhat expect_equal_to_reference
316
expect_ihm_equal_to_reference <- function(object, file, ..., info = NULL) {
@@ -11,8 +24,8 @@ expect_ihm_equal_to_reference <- function(object, file, ..., info = NULL) {
1124
} else {
1225
reference <- readRDS(file)
1326

14-
objectsub <- object$x[c("data","layout")]
15-
referencesub <- reference$x[c("data","layout")]
27+
objectsub <- replace_colorscales(object$x[c("data","layout")])
28+
referencesub <- replace_colorscales(reference$x[c("data","layout")])
1629

1730
comp <- testthat::compare(objectsub, referencesub, ...)
1831
expect(
@@ -38,11 +51,6 @@ expect_iheatmap <- function(test_plot, ref_name,
3851
}
3952
expect_is(test_widget,"htmlwidget")
4053
expect_is(test_widget,"iheatmapr")
41-
if (packageVersion("scales") > "1.0.0") {
42-
expect_ihm_equal_to_reference(test_widget, paste0("reference/",
43-
ref_name,"_v2.rds"))
44-
} else {
45-
expect_ihm_equal_to_reference(test_widget, paste0("reference/",
54+
expect_ihm_equal_to_reference(test_widget, paste0("reference/",
4655
ref_name,".rds"))
47-
}
4856
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-27.4 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-26.8 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
-27.5 KB
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)