Skip to content

Commit 9904efc

Browse files
committed
Test for incomplete theme() docs
1 parent c02c05a commit 9904efc

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
@@ -693,3 +693,14 @@ test_that("legends are placed correctly when using stretchy spacing", {
693693
p + theme(legend.position = "top", legend.spacing.x = unit(1, "null"))
694694
)
695695
})
696+
697+
test_that("all theme elements are documented", {
698+
all_elems <- names(.element_tree)
699+
doc_fmls <- rlang::fn_fmls_names(theme)
700+
missing_elems <- setdiff(all_elems, doc_fmls)
701+
702+
expect(length(missing_elems) == 0, c(
703+
"Expected all elements in `.element_tree` to have corresponding parameters in `theme()`.",
704+
sprintf("Element is missing from theme(): %s", paste(missing_elems))
705+
))
706+
})

0 commit comments

Comments
 (0)