From aca18b56ce0572513b5acbb5254dd5ddfdfc3c85 Mon Sep 17 00:00:00 2001 From: Abinaya Yogasekaram <73252787+ayogasekaram@users.noreply.github.com> Date: Thu, 4 Jan 2024 17:35:36 -0500 Subject: [PATCH] update snapshots (#1166) updating snaps to pass integration tests. Difference in font. --------- Co-authored-by: Emily de la Rua --- tests/testthat/_snaps/g_forest/g_forest.svg | 186 +++++++++--------- .../_snaps/g_forest/g_forest_custom_1.svg | 62 +++--- .../_snaps/g_forest/g_forest_custom_2.svg | 78 ++++---- .../_snaps/g_forest/g_forest_custom_3.svg | 70 +++---- .../testthat/_snaps/g_forest/g_forest_or.svg | 130 ++++++------ .../_snaps/g_forest/g_forest_plot_only.svg | 70 +++---- .../_snaps/g_forest/g_forest_table_only.svg | 104 +++++----- .../testthat/_snaps/g_lineplot/g-lineplot.svg | 68 +++---- .../utils_ggplot/rtable2gg_colsplits.svg | 116 +++++------ .../_snaps/utils_ggplot/rtable2gg_cw.svg | 108 +++++----- .../_snaps/utils_ggplot/rtable2gg_default.svg | 108 +++++----- .../_snaps/utils_ggplot/rtable2gg_fs.svg | 108 +++++----- .../_snaps/utils_ggplot/rtable2gg_lblpad.svg | 108 +++++----- tests/testthat/setup.R | 3 +- 14 files changed, 659 insertions(+), 660 deletions(-) diff --git a/tests/testthat/_snaps/g_forest/g_forest.svg b/tests/testthat/_snaps/g_forest/g_forest.svg index b8127830d8..e214f9b4ed 100644 --- a/tests/testthat/_snaps/g_forest/g_forest.svg +++ b/tests/testthat/_snaps/g_forest/g_forest.svg @@ -23,66 +23,66 @@ - - + + - - -A: Drug X - -B: Placebo - -Baseline Risk Factors -All Patients -Sex - F - M -Stratification Factor 2 - S1 - S2 -Total n -20 -11 -9 -10 -10 -n -11 -6 -5 -5 -6 -Response (%) -72.7% -100.0% -40.0% -80.0% -66.7% -n -9 -5 -4 -5 -4 -Response (%) -77.8% -80.0% -75.0% -80.0% -75.0% -Odds Ratio -1.31 -<0.01 -4.50 -1.00 -1.50 -95% CI -(0.17, 10.26) -(0.00, >999.99) -(0.25, 80.57) -(0.05, 22.18) -(0.09, 25.39) + + +A: Drug X + +B: Placebo + +Baseline Risk Factors +All Patients +Sex + F + M +Stratification Factor 2 + S1 + S2 +Total n +20 +11 +9 +10 +10 +n +11 +6 +5 +5 +6 +Response (%) +72.7% +100.0% +40.0% +80.0% +66.7% +n +9 +5 +4 +5 +4 +Response (%) +77.8% +80.0% +75.0% +80.0% +75.0% +Odds Ratio +1.31 +<0.01 +4.50 +1.00 +1.50 +95% CI +(0.17, 10.26) +(0.00, >999.99) +(0.25, 80.57) +(0.05, 22.18) +(0.09, 25.39) @@ -95,40 +95,40 @@ - - - - - - - -A: Drug X -Better -B: Placebo -Better - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -10 + + + + + + + +A: Drug X +Better +B: Placebo +Better + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +10 diff --git a/tests/testthat/_snaps/g_forest/g_forest_custom_1.svg b/tests/testthat/_snaps/g_forest/g_forest_custom_1.svg index d2baeebc16..68962df6ef 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_custom_1.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_custom_1.svg @@ -23,22 +23,22 @@ - - + + - - -A - -row 1 -row 2 -c1 -1 -1.2 -c2 -0.8, 1.2 -1.1, 1.4 + + +A + +row 1 +row 2 +c1 +1 +1.2 +c2 +0.8, 1.2 +1.1, 1.4 @@ -51,22 +51,22 @@ - - - - -Hello -World - - - - - - - - -0.5 -1 -2 + + + + +Hello +World + + + + + + + + +0.5 +1 +2 diff --git a/tests/testthat/_snaps/g_forest/g_forest_custom_2.svg b/tests/testthat/_snaps/g_forest/g_forest_custom_2.svg index 4291776deb..fd80e48075 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_custom_2.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_custom_2.svg @@ -23,22 +23,22 @@ - - + + - - -A - -row 1 -row 2 -c1 -1 -1.2 -c2 -0.8, 1.2 -1.1, 1.4 + + +A + +row 1 +row 2 +c1 +1 +1.2 +c2 +0.8, 1.2 +1.1, 1.4 @@ -51,30 +51,30 @@ - - - - -Comparison -Better -Treatment -Better - - - - - - - - - - - -0.5 -0.7 -0.9 -1.1 -1.3 -1.5 + + + + +Comparison +Better +Treatment +Better + + + + + + + + + + + +0.5 +0.7 +0.9 +1.1 +1.3 +1.5 diff --git a/tests/testthat/_snaps/g_forest/g_forest_custom_3.svg b/tests/testthat/_snaps/g_forest/g_forest_custom_3.svg index 8fdf9c335e..3f966d7107 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_custom_3.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_custom_3.svg @@ -23,22 +23,22 @@ - - + + - - -A - -row 1 -row 2 -c1 -1 -1.2 -c2 -0.8, 1.2 -1.1, 1.4 + + +A + +row 1 +row 2 +c1 +1 +1.2 +c2 +0.8, 1.2 +1.1, 1.4 @@ -51,26 +51,26 @@ - - - - -c1 -is -better -c2 -is -better - - - - - - - - -0.5 -1 -2 + + + + +c1 +is +better +c2 +is +better + + + + + + + + +0.5 +1 +2 diff --git a/tests/testthat/_snaps/g_forest/g_forest_or.svg b/tests/testthat/_snaps/g_forest/g_forest_or.svg index bd5b17519d..383ef1d995 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_or.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_or.svg @@ -23,38 +23,38 @@ - - + + - - -Baseline Risk Factors -All Patients -Sex - F - M -Stratification Factor 2 - S1 - S2 -Total n -20 -11 -9 -10 -10 -Odds Ratio -1.31 -<0.01 -4.50 -1.00 -1.50 -95% CI -(0.17, 10.26) -(0.00, >999.99) -(0.25, 80.57) -(0.05, 22.18) -(0.09, 25.39) + + +Baseline Risk Factors +All Patients +Sex + F + M +Stratification Factor 2 + S1 + S2 +Total n +20 +11 +9 +10 +10 +Odds Ratio +1.31 +<0.01 +4.50 +1.00 +1.50 +95% CI +(0.17, 10.26) +(0.00, >999.99) +(0.25, 80.57) +(0.05, 22.18) +(0.09, 25.39) @@ -67,40 +67,40 @@ - - - - - - - -Comparison -Better -Treatment -Better - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -10 + + + + + + + +Comparison +Better +Treatment +Better + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +10 diff --git a/tests/testthat/_snaps/g_forest/g_forest_plot_only.svg b/tests/testthat/_snaps/g_forest/g_forest_plot_only.svg index edc2367fec..d7f9c3c211 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_plot_only.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_plot_only.svg @@ -22,40 +22,40 @@ - - - - - - - -A: Drug X -Better -B: Placebo -Better - - - - - - - - - - - - - - - - - - - - - -0.1 -1 -10 + + + + + + + +A: Drug X +Better +B: Placebo +Better + + + + + + + + + + + + + + + + + + + + + +0.1 +1 +10 diff --git a/tests/testthat/_snaps/g_forest/g_forest_table_only.svg b/tests/testthat/_snaps/g_forest/g_forest_table_only.svg index e6a78b50db..d191771904 100644 --- a/tests/testthat/_snaps/g_forest/g_forest_table_only.svg +++ b/tests/testthat/_snaps/g_forest/g_forest_table_only.svg @@ -29,60 +29,60 @@ -A: Drug X +A: Drug X -B: Placebo +B: Placebo -Baseline Risk Factors -All Patients -Sex - F - M -Stratification Factor 2 - S1 - S2 -Total n -20 -11 -9 -10 -10 -n -11 -6 -5 -5 -6 -Response (%) -72.7% -100.0% -40.0% -80.0% -66.7% -n -9 -5 -4 -5 -4 -Response (%) -77.8% -80.0% -75.0% -80.0% -75.0% -Odds Ratio -1.31 -<0.01 -4.50 -1.00 -1.50 -95% CI -(0.17, 10.26) -(0.00, >999.99) -(0.25, 80.57) -(0.05, 22.18) -(0.09, 25.39) +Baseline Risk Factors +All Patients +Sex + F + M +Stratification Factor 2 + S1 + S2 +Total n +20 +11 +9 +10 +10 +n +11 +6 +5 +5 +6 +Response (%) +72.7% +100.0% +40.0% +80.0% +66.7% +n +9 +5 +4 +5 +4 +Response (%) +77.8% +80.0% +75.0% +80.0% +75.0% +Odds Ratio +1.31 +<0.01 +4.50 +1.00 +1.50 +95% CI +(0.17, 10.26) +(0.00, >999.99) +(0.25, 80.57) +(0.05, 22.18) +(0.09, 25.39) diff --git a/tests/testthat/_snaps/g_lineplot/g-lineplot.svg b/tests/testthat/_snaps/g_lineplot/g-lineplot.svg index 80c90fc409..4138bb9b73 100644 --- a/tests/testthat/_snaps/g_lineplot/g-lineplot.svg +++ b/tests/testthat/_snaps/g_lineplot/g-lineplot.svg @@ -22,7 +22,7 @@ - + @@ -31,28 +31,28 @@ - - - - - - - + + + + + + + - - - + + + - - - + + + - - + + @@ -66,11 +66,11 @@ - - - - - + + + + + @@ -84,24 +84,24 @@ - - - - + + + + - - + + - - + + - - + + - + 18 @@ -113,7 +113,7 @@ - + @@ -143,7 +143,7 @@ A: Drug X (N = 69) B: Placebo (N = 73) C: Combination (N = 58) -ALT (U/L) +ALT (U/L) Plot of Mean and 95% Confidence Limits by Visit diff --git a/tests/testthat/_snaps/utils_ggplot/rtable2gg_colsplits.svg b/tests/testthat/_snaps/utils_ggplot/rtable2gg_colsplits.svg index cc2bf0a6db..f562ea5c25 100644 --- a/tests/testthat/_snaps/utils_ggplot/rtable2gg_colsplits.svg +++ b/tests/testthat/_snaps/utils_ggplot/rtable2gg_colsplits.svg @@ -22,69 +22,69 @@ -A +A -B +B -V1 +V1 -V2 +V2 -V1 +V1 -V2 +V2 -n -Mean (SD) -Median -Min - Max -M -(N=4) -4 -5.0 (3.7) -5.0 -1.0 - 9.0 -F -(N=1) -1 -5.0 (NA) -5.0 -5.0 - 5.0 -M -(N=2) -2 -5.0 (1.4) -5.0 -4.0 - 6.0 -F -(N=2) -2 -5.0 (4.2) -5.0 -2.0 - 8.0 -M -(N=2) -2 -14.0 (1.4) -14.0 -13.0 - 15.0 -F -(N=2) -1 -11.0 (NA) -11.0 -11.0 - 11.0 -M -(N=4) -2 -11.0 (1.4) -11.0 -10.0 - 12.0 -F -(N=1) -1 -14.0 (NA) -14.0 -14.0 - 14.0 +n +Mean (SD) +Median +Min - Max +M +(N=4) +4 +5.0 (3.7) +5.0 +1.0 - 9.0 +F +(N=1) +1 +5.0 (NA) +5.0 +5.0 - 5.0 +M +(N=2) +2 +5.0 (1.4) +5.0 +4.0 - 6.0 +F +(N=2) +2 +5.0 (4.2) +5.0 +2.0 - 8.0 +M +(N=2) +2 +14.0 (1.4) +14.0 +13.0 - 15.0 +F +(N=2) +1 +11.0 (NA) +11.0 +11.0 - 11.0 +M +(N=4) +2 +11.0 (1.4) +11.0 +10.0 - 12.0 +F +(N=1) +1 +14.0 (NA) +14.0 +14.0 - 14.0 diff --git a/tests/testthat/_snaps/utils_ggplot/rtable2gg_cw.svg b/tests/testthat/_snaps/utils_ggplot/rtable2gg_cw.svg index 6bbf589ca3..1af5ce6450 100644 --- a/tests/testthat/_snaps/utils_ggplot/rtable2gg_cw.svg +++ b/tests/testthat/_snaps/utils_ggplot/rtable2gg_cw.svg @@ -22,59 +22,59 @@ -V1 - n - Mean (SD) - Median - Min - Max -V2 - n - Mean (SD) - Median - Min - Max -V3 - n - Mean (SD) - Median - Min - Max -A -2 -7.5 (2.1) -7.5 -6.0 - 9.0 -2 -6.5 (2.1) -6.5 -5.0 - 8.0 -2 -5.5 (2.1) -5.5 -4.0 - 7.0 -B -1 -3.0 (NA) -3.0 -3.0 - 3.0 -1 -2.0 (NA) -2.0 -2.0 - 2.0 -1 -1.0 (NA) -1.0 -1.0 - 1.0 -C -0 -NA -NA -NA -0 -NA -NA -NA -0 -NA -NA -NA +V1 + n + Mean (SD) + Median + Min - Max +V2 + n + Mean (SD) + Median + Min - Max +V3 + n + Mean (SD) + Median + Min - Max +A +2 +7.5 (2.1) +7.5 +6.0 - 9.0 +2 +6.5 (2.1) +6.5 +5.0 - 8.0 +2 +5.5 (2.1) +5.5 +4.0 - 7.0 +B +1 +3.0 (NA) +3.0 +3.0 - 3.0 +1 +2.0 (NA) +2.0 +2.0 - 2.0 +1 +1.0 (NA) +1.0 +1.0 - 1.0 +C +0 +NA +NA +NA +0 +NA +NA +NA +0 +NA +NA +NA diff --git a/tests/testthat/_snaps/utils_ggplot/rtable2gg_default.svg b/tests/testthat/_snaps/utils_ggplot/rtable2gg_default.svg index 510ec9d680..48a7358cee 100644 --- a/tests/testthat/_snaps/utils_ggplot/rtable2gg_default.svg +++ b/tests/testthat/_snaps/utils_ggplot/rtable2gg_default.svg @@ -22,59 +22,59 @@ -V1 - n - Mean (SD) - Median - Min - Max -V2 - n - Mean (SD) - Median - Min - Max -V3 - n - Mean (SD) - Median - Min - Max -A -2 -7.5 (2.1) -7.5 -6.0 - 9.0 -2 -6.5 (2.1) -6.5 -5.0 - 8.0 -2 -5.5 (2.1) -5.5 -4.0 - 7.0 -B -1 -3.0 (NA) -3.0 -3.0 - 3.0 -1 -2.0 (NA) -2.0 -2.0 - 2.0 -1 -1.0 (NA) -1.0 -1.0 - 1.0 -C -0 -NA -NA -NA -0 -NA -NA -NA -0 -NA -NA -NA +V1 + n + Mean (SD) + Median + Min - Max +V2 + n + Mean (SD) + Median + Min - Max +V3 + n + Mean (SD) + Median + Min - Max +A +2 +7.5 (2.1) +7.5 +6.0 - 9.0 +2 +6.5 (2.1) +6.5 +5.0 - 8.0 +2 +5.5 (2.1) +5.5 +4.0 - 7.0 +B +1 +3.0 (NA) +3.0 +3.0 - 3.0 +1 +2.0 (NA) +2.0 +2.0 - 2.0 +1 +1.0 (NA) +1.0 +1.0 - 1.0 +C +0 +NA +NA +NA +0 +NA +NA +NA +0 +NA +NA +NA diff --git a/tests/testthat/_snaps/utils_ggplot/rtable2gg_fs.svg b/tests/testthat/_snaps/utils_ggplot/rtable2gg_fs.svg index a60809180e..ebbe59c53d 100644 --- a/tests/testthat/_snaps/utils_ggplot/rtable2gg_fs.svg +++ b/tests/testthat/_snaps/utils_ggplot/rtable2gg_fs.svg @@ -22,59 +22,59 @@ -V1 - n - Mean (SD) - Median - Min - Max -V2 - n - Mean (SD) - Median - Min - Max -V3 - n - Mean (SD) - Median - Min - Max -A -2 -7.5 (2.1) -7.5 -6.0 - 9.0 -2 -6.5 (2.1) -6.5 -5.0 - 8.0 -2 -5.5 (2.1) -5.5 -4.0 - 7.0 -B -1 -3.0 (NA) -3.0 -3.0 - 3.0 -1 -2.0 (NA) -2.0 -2.0 - 2.0 -1 -1.0 (NA) -1.0 -1.0 - 1.0 -C -0 -NA -NA -NA -0 -NA -NA -NA -0 -NA -NA -NA +V1 + n + Mean (SD) + Median + Min - Max +V2 + n + Mean (SD) + Median + Min - Max +V3 + n + Mean (SD) + Median + Min - Max +A +2 +7.5 (2.1) +7.5 +6.0 - 9.0 +2 +6.5 (2.1) +6.5 +5.0 - 8.0 +2 +5.5 (2.1) +5.5 +4.0 - 7.0 +B +1 +3.0 (NA) +3.0 +3.0 - 3.0 +1 +2.0 (NA) +2.0 +2.0 - 2.0 +1 +1.0 (NA) +1.0 +1.0 - 1.0 +C +0 +NA +NA +NA +0 +NA +NA +NA +0 +NA +NA +NA diff --git a/tests/testthat/_snaps/utils_ggplot/rtable2gg_lblpad.svg b/tests/testthat/_snaps/utils_ggplot/rtable2gg_lblpad.svg index 7b6993377d..1ef1e2d376 100644 --- a/tests/testthat/_snaps/utils_ggplot/rtable2gg_lblpad.svg +++ b/tests/testthat/_snaps/utils_ggplot/rtable2gg_lblpad.svg @@ -22,59 +22,59 @@ -V1 - n - Mean (SD) - Median - Min - Max -V2 - n - Mean (SD) - Median - Min - Max -V3 - n - Mean (SD) - Median - Min - Max -A -2 -7.5 (2.1) -7.5 -6.0 - 9.0 -2 -6.5 (2.1) -6.5 -5.0 - 8.0 -2 -5.5 (2.1) -5.5 -4.0 - 7.0 -B -1 -3.0 (NA) -3.0 -3.0 - 3.0 -1 -2.0 (NA) -2.0 -2.0 - 2.0 -1 -1.0 (NA) -1.0 -1.0 - 1.0 -C -0 -NA -NA -NA -0 -NA -NA -NA -0 -NA -NA -NA +V1 + n + Mean (SD) + Median + Min - Max +V2 + n + Mean (SD) + Median + Min - Max +V3 + n + Mean (SD) + Median + Min - Max +A +2 +7.5 (2.1) +7.5 +6.0 - 9.0 +2 +6.5 (2.1) +6.5 +5.0 - 8.0 +2 +5.5 (2.1) +5.5 +4.0 - 7.0 +B +1 +3.0 (NA) +3.0 +3.0 - 3.0 +1 +2.0 (NA) +2.0 +2.0 - 2.0 +1 +1.0 (NA) +1.0 +1.0 - 1.0 +C +0 +NA +NA +NA +0 +NA +NA +NA +0 +NA +NA +NA diff --git a/tests/testthat/setup.R b/tests/testthat/setup.R index 2de31cfe32..9c74d4d29f 100644 --- a/tests/testthat/setup.R +++ b/tests/testthat/setup.R @@ -26,11 +26,10 @@ expect_snapshot_ggplot <- function(title, fig, width = NA, height = NA) { skip_if_not_installed("svglite") name <- paste0(title, ".svg") - path <- "_snaps" + path <- tempdir() suppressMessages(ggplot2::ggsave(name, fig, path = path, width = width, height = height)) path <- file.path(path, name) testthat::announce_snapshot_file(name = name) testthat::expect_snapshot_file(path, name) - unlink(path) }