test_that("stamp_logo_png preserves image dimensions and returns the path invisibly", { p <- tempfile(fileext = ".png") on.exit(unlink(p), add = TRUE) grDevices::png(p, width = 600, height = 240); plot(1:5); grDevices::dev.off() in_dim <- dim(png::readPNG(p))[1:2] expect_invisible(out <- stamp_logo_png(p)) expect_identical(out, p) expect_identical(dim(png::readPNG(p))[1:2], in_dim) # overwritten at same size }) test_that("stamp_logo_png runs for every type/variant/position combination", { p <- tempfile(fileext = ".png") on.exit(unlink(p), add = TRUE) grDevices::png(p, width = 500, height = 200); plot(1:5); grDevices::dev.off() for (ty in c("wordmark", "mark")) { for (va in c("light", "dark")) { for (pos in c("bottom-right", "bottom-left", "top-right", "top-left")) { expect_no_error(stamp_logo_png(p, type = ty, variant = va, position = pos)) } } } }) test_that("stamp_logo_png validates its inputs", { expect_error(stamp_logo_png(tempfile(fileext = ".png"))) # file does not exist # invalid type is rejected by match.arg() before the file is touched expect_error(stamp_logo_png(tempfile(fileext = ".png"), type = "banner")) })