Add missing variable in templates regarding toc (#127)
Related to #123 and alignement with `html_document()` behavior
diff --git a/tests/testthat/test-revealjs_presentation.R b/tests/testthat/test-revealjs_presentation.R
new file mode 100644
index 0000000..ade1c9a
--- /dev/null
+++ b/tests/testthat/test-revealjs_presentation.R
@@ -0,0 +1,20 @@
+test_that("toc argument works", {
+ skip_if_not_pandoc()
+ skip_if_not_installed("xml2")
+ rmd <- local_temp_draft()
+ html <- .render_and_read(
+ rmd,
+ output_options = list(
+ toc = TRUE,
+ pandoc_args = c(pandoc_variable_arg("toc-title", "TOC"))
+ )
+ )
+ toc <- xml2::xml_find_all(html, "//section[@id='TOC']")
+ expect_length(toc, 1)
+ expect_equal(
+ xml2::xml_text(
+ xml2::xml_find_all(toc, "./nav/*[contains(@id, 'toc-title')]")
+ ),
+ "TOC"
+ )
+})