Skip to content

Commit fbf3f89

Browse files
committed
Test for incomplete theme() docs
1 parent efc53cc commit fbf3f89

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

tests/testthat/test-theme.R

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -949,3 +949,14 @@ test_that("legend margins are correct when using relative key sizes", {
949949

950950
expect_doppelganger("stretched horizontal legends", horizontal)
951951
})
952+
953+
test_that("all theme elements are documented", {
954+
all_elems <- names(.element_tree)
955+
doc_fmls <- rlang::fn_fmls_names(theme)
956+
missing_elems <- setdiff(all_elems, doc_fmls)
957+
958+
expect(length(missing_elems) == 0, c(
959+
"Expected all elements in `.element_tree` to have corresponding parameters in `theme()`.",
960+
sprintf("Element is missing from theme(): %s", paste(missing_elems))
961+
))
962+
})

0 commit comments

Comments
 (0)