Skip to content

Commit

Permalink
portable tests local only
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentarelbundock committed Oct 5, 2024
1 parent 7a0f291 commit 49eade9
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions inst/tinytest/test-html.R
Original file line number Diff line number Diff line change
Expand Up @@ -187,16 +187,18 @@ expect_snapshot_print(print_html(dat), "html-issue297")


# Issue #340: plot_tt should be able to create self-contained HTML
dat <- data.frame(
Name = c("bar", "line"),
Image = "") |>
tt() |>
plot_tt(i = 1, j = 2, fun = "bar", data = list(2)) |>
plot_tt(i = 2, j = 2, fun = "line", data = list(data.frame(x = 1:3, y = 3:1)))
expect_snapshot_print(print_html(dat, "html_portable"), "html-images-portable.html")
op = options("tinytable_html_portable" = TRUE)
expect_snapshot_print(print_html(dat, "html"), "html-images-portable.html")
options(op)
if (Sys.info()["user"] == "vincent") {
dat <- data.frame(
Name = c("bar", "line"),
Image = "") |>
tt() |>
plot_tt(i = 1, j = 2, fun = "bar", data = list(2)) |>
plot_tt(i = 2, j = 2, fun = "line", data = list(data.frame(x = 1:3, y = 3:1)))
expect_snapshot_print(print_html(dat, "html_portable"), "html-images-portable.html")
op = options("tinytable_html_portable" = TRUE)
expect_snapshot_print(print_html(dat, "html"), "html-images-portable.html")
options(op)
}

# # Built-in plots
# # cannot be tested because the names of plots are random and set seed doesn't work
Expand Down

0 comments on commit 49eade9

Please sign in to comment.