Skip to content

Commit

Permalink
remove pointless test
Browse files Browse the repository at this point in the history
  • Loading branch information
gowerc committed Jun 21, 2024
1 parent 6fad997 commit 5b62356
Showing 1 changed file with 32 additions and 32 deletions.
64 changes: 32 additions & 32 deletions tests/testthat/test-survival_plot.R
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,16 @@ test_that("survival_plot works as expected", {
get_data(3, "C")
)

p1 <- survival_plot(
res,
add_ci = TRUE,
add_wrap = TRUE,
kmdf = NULL,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
)
testthat::expect_no_error({
p1 <- survival_plot(
res,
add_ci = TRUE,
add_wrap = TRUE,
kmdf = NULL,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
)
})


announce_snapshot_file(file.path(snap_dir, "wrap-ci.svg"))
Expand All @@ -79,15 +81,16 @@ test_that("survival_plot works as expected", {
)
}


p2 <- survival_plot(
res,
add_ci = FALSE,
add_wrap = FALSE,
kmdf = NULL,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
)
testthat::expect_no_error({
p2 <- survival_plot(
res,
add_ci = FALSE,
add_wrap = FALSE,
kmdf = NULL,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
)
})

announce_snapshot_file(file.path(snap_dir, "nowrap-noci.svg"))
if (is_graph_snapshot_enabled()) {
Expand All @@ -97,17 +100,18 @@ test_that("survival_plot works as expected", {
)
}


p3 <- survival_plot(
res,
add_ci = FALSE,
add_wrap = FALSE,
kmdf = dat,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
) +
theme(legend.position = "bottom") +
scale_y_continuous(trans = "sqrt")
testthat::expect_no_error({
p3 <- survival_plot(
res,
add_ci = FALSE,
add_wrap = FALSE,
kmdf = dat,
y_label = expression(frac(1, 2) + S(t^2)),
x_label = expression(thd[3])
) +
theme(legend.position = "bottom") +
scale_y_continuous(trans = "sqrt")
})

announce_snapshot_file(file.path(snap_dir, "nowrap-noci-km-ggplot2.svg"))
if (is_graph_snapshot_enabled()) {
Expand All @@ -116,8 +120,4 @@ test_that("survival_plot works as expected", {
p3
)
}

# Null test so that its not considered as an empty test if the "JMPOST_GRAPH_SNAPSHOT"
# variable is not set
expect_equal(1, 1)
})

0 comments on commit 5b62356

Please sign in to comment.