From 2badbf0c5100f333bfaf4ec5d7d07d1f80380915 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Tue, 17 Sep 2024 21:18:22 -0400 Subject: [PATCH] Add tests for `opt_table_font()` --- tests/testthat/test-opts.R | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/tests/testthat/test-opts.R b/tests/testthat/test-opts.R index a90114780e..40d45ab256 100644 --- a/tests/testthat/test-opts.R +++ b/tests/testthat/test-opts.R @@ -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