Skip to content

Commit

Permalink
Add tests for opt_table_font()
Browse files Browse the repository at this point in the history
  • Loading branch information
rich-iannone committed Sep 18, 2024
1 parent e679737 commit 2badbf0
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions tests/testthat/test-opts.R
Original file line number Diff line number Diff line change
Expand Up @@ -340,6 +340,22 @@ test_that("opt_table_font() sets the correct options", {
"font-weight: bold;",
"font-style: italic;"
) %>% expect_true()

# Expect that the `size` option is passed as a CSS value
tbl %>%
opt_table_font(size = px(32)) %>%
compile_scss() %>%
as.character() %>%
html_fragment_within("font-size: 32px;") %>%
expect_true()

# Expect that the `color` option is passed as a CSS value
tbl %>%
opt_table_font(color = "#228B23") %>%
compile_scss() %>%
as.character() %>%
html_fragment_within("color: #228B23;") %>%
expect_true()

# Expect that adding a font from the Google Fonts service
# is possible with the `google_font()` function
Expand Down

0 comments on commit 2badbf0

Please sign in to comment.