tests/testthat/test-build-logo.R

test_that("can handle logo in subdir", {

  src <- withr::local_tempdir()
  dst <- withr::local_tempdir()

  dir_create(path(src, "man", "figures"))
  file_create(path(src, "man", "figures", "logo.svg"))
  pkg <- structure(list(src_path = src, dst_path = dst), class = "pkgdown")
  expect_true((pkg))

  expect_snapshot((pkg))
  expect_true(file_exists(path(dst, "logo.svg")))

  expect_equal(logo_path(pkg, 0), "logo.svg")
  expect_equal(logo_path(pkg, 1), "../logo.svg")
})
hadley/staticdocs documentation built on May 4, 2024, 3:08 a.m.