Skip to content

Commit

Permalink
tests: Update and fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
gadenbuie committed Sep 15, 2024
1 parent 8d759a5 commit 2a8fa1f
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ README.html
.history/

# Directories that start with _
_*/
/_*/

## https://github.com/github/gitignore/blob/master/R.gitignore
# History files
Expand Down
2 changes: 1 addition & 1 deletion R/style_extra_css.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ list2css <- function(css) {
if (is.null(names(css))) {
stop("All elements in `css` list must be named", call. = FALSE)
}
if (purrr::vec_depth(css) != 3) {
if (purrr::pluck_depth(css) != 3) {
stop(str_wrap(
"`css` list must be a named list within a named list, e.g.:\n",
' list(".class-id" = list("css-property" = "value"))'
Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/_snaps/utils.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# printing google_font works

Code
google_font("Josefin Sans", "400", "400i", "600i", "700")
Output
Family: Josefin Sans
Weights: 400,400i,600i,700
URL: https://fonts.googleapis.com/css?family=Josefin+Sans:400,400i,600i,700&display=swap

2 changes: 1 addition & 1 deletion tests/testthat/test-ggplot2.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,7 @@ test_that("theme_xaringan_restore_defaults() restores defaults", {
expect_equal(res$after_set$line_colour, "#0088ff")
expect_equal(res$after_set$bar_fill, "#FF8800")
expect_equal(res$after_restore$line_colour, res$original$colour)
expect_equal(res$after_restore$bar_fill, res$original$fil)
expect_equal(res$after_restore$bar_fill, res$original$fill)
})

describe("theme_xaringan_get_value()", {
Expand Down

0 comments on commit 2a8fa1f

Please sign in to comment.