Skip to content

Commit

Permalink
add dims to wb_add_conditional_formatting(). closes #654
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Jun 21, 2023
1 parent 4a9144a commit 86010c1
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions R/class-workbook-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -2891,6 +2891,7 @@ wb_add_conditional_formatting <- function(
assert_workbook(wb)
wb$clone()$add_conditional_formatting(
sheet = sheet,
dims = dims,
cols = cols,
rows = rows,
rule = rule,
Expand Down
9 changes: 9 additions & 0 deletions tests/testthat/test-conditional_formatting.R
Original file line number Diff line number Diff line change
Expand Up @@ -789,4 +789,13 @@ test_that("conditional formatting with gradientFill works", {
got <- wb$styles_mgr$styles$dxfs
expect_equal(exp, got)

# check that the wrapper handles dims as well
expect_silent(
wb_workbook() %>%
wb_add_worksheet() %>%
wb_add_conditional_formatting(dims = "A1:B5",
type = "between",
rule = c(2, 4))
)

})

0 comments on commit 86010c1

Please sign in to comment.