-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
5a1f7f1
commit 7ef4a41
Showing
3 changed files
with
38 additions
and
9 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
test_that("clean heading text", { | ||
clean_heading_check <- clean_heading_text("This is my clean heading link!") | ||
|
||
expect_equal( | ||
"this_is_my_clean_heading_link", | ||
clean_heading_check | ||
) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,28 @@ | ||
# Check contents link | ||
test_that("contents_link", { | ||
contents_check <- contents_links("Test content link", "test_content_link") | ||
|
||
expect_equal( | ||
"test_content_link", | ||
contents_links("Test content link", "test_content_link")$children[[1]]$attribs$id | ||
) | ||
expect_equal("test_content_link", contents_check$children[[1]]$attribs$id) | ||
}) | ||
|
||
|
||
# Check subcontents in contents link | ||
test_that("subcontents in contents_link", { | ||
contents_check <- contents_links("Test content link", | ||
"test_content_link", | ||
c("My test", "Subcontents", "Links")) | ||
|
||
expect_equal("#my_test", | ||
contents_check$children[[2]]$children[[1]][[1]]$children[[2]]$attribs$href) | ||
}) | ||
|
||
# Check custom subcontents links | ||
test_that("custom subcontents in contents_link", { | ||
contents_check <- contents_links("Test content link", | ||
"test_content_link", | ||
c("My test", "Subcontents", "Links"), | ||
c(NA, NA, "my_custom_link")) | ||
|
||
expect_equal("#my_custom_link", | ||
contents_check$children[[2]]$children[[1]][[3]]$children[[2]]$attribs$href) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters