Skip to content

Commit

Permalink
tests: test HTML images
Browse files Browse the repository at this point in the history
  • Loading branch information
davidgohel committed Feb 4, 2024
1 parent dfd7fc7 commit 0710c19
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions tests/testthat/test-images.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,16 @@ svg_file <- file.path(R.home(component = "doc"), "html", "Rlogo.svg")
ext_img <- external_img(img.file)
ext_svg <- external_img(svg_file)

test_that("add image in HTML", {
expect_match(
to_html(ext_svg),
"<img style=\"vertical-align:middle;width:36px;height:14px;\" src=\"data:image/svg\\+xml;base64,"
)
expect_match(
to_html(ext_img),
"<img style=\"vertical-align:middle;width:36px;height:14px;\" src=\"data:image/jpeg;base64,"
)
})

test_that("add image in docx", {
x <- read_docx()
Expand Down

0 comments on commit 0710c19

Please sign in to comment.