diff --git a/tests/testthat/_snaps/facet-sample/gg-facet-sample.svg b/tests/testthat/_snaps/facet-sample/gg-facet-sample.svg index 9e5f3bf..7e67b47 100644 --- a/tests/testthat/_snaps/facet-sample/gg-facet-sample.svg +++ b/tests/testthat/_snaps/facet-sample/gg-facet-sample.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/facet-strata/gg-facet-strata.svg b/tests/testthat/_snaps/facet-strata/gg-facet-strata.svg index 2b84aeb..312f2a6 100644 --- a/tests/testthat/_snaps/facet-strata/gg-facet-strata.svg +++ b/tests/testthat/_snaps/facet-strata/gg-facet-strata.svg @@ -18,7 +18,7 @@ - + diff --git a/tests/testthat/_snaps/keys-near.md b/tests/testthat/_snaps/keys-near.md index ac55679..5856b8f 100644 --- a/tests/testthat/_snaps/keys-near.md +++ b/tests/testthat/_snaps/keys-near.md @@ -23,13 +23,12 @@ Code summarise_slope Output - # A tibble: 6 x 5 + # A tibble: 5 x 5 id .slope_xp stat stat_value stat_diff - 1 2305 0.0480 med 0.0480 0.0000498 - 2 2594 -0.00768 q_25 -0.00769 0.0000127 - 3 7918 -4.58 min -4.58 0 - 4 10380 0.0479 med 0.0480 0.0000498 - 5 12178 0.0946 q_75 0.0947 0.0000579 - 6 12455 13.2 max 13.2 0 + 1 2594 -0.00768 q_25 -0.00769 0.0000127 + 2 7918 -4.58 min -4.58 0 + 3 10380 0.0479 med 0.0480 0.0000498 + 4 12178 0.0946 q_75 0.0947 0.0000579 + 5 12455 13.2 max 13.2 0 diff --git a/tests/testthat/_snaps/keys-near/stat-plot.svg b/tests/testthat/_snaps/keys-near/stat-plot.svg new file mode 100644 index 0000000..bb5bb24 --- /dev/null +++ b/tests/testthat/_snaps/keys-near/stat-plot.svg @@ -0,0 +1,923 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +1 +2 +3 +4 + + + + + + + +0 +5 +10 +xp +ln_wages + +stat + + + + + + + + + + +min +q_25 +med +q_75 +max +stat_plot + + diff --git a/tests/testthat/test-keys-near.R b/tests/testthat/test-keys-near.R index 1bee44c..0775d26 100644 --- a/tests/testthat/test-keys-near.R +++ b/tests/testthat/test-keys-near.R @@ -19,3 +19,32 @@ test_that("keys_near returns the same dimension and names etc", { expect_snapshot(summarise_ln_wages) expect_snapshot(summarise_slope) }) + +summarised_slop_add_data <- dplyr::left_join( + summarise_slope, + wages, + by = "id" +) + +plot_stat <- ggplot(summarised_slop_add_data, + aes( + x = xp, + y = ln_wages, + group = id + ) + ) + + geom_line( + data = wages, + colour = "grey50", + alpha = 0.5 + ) + + geom_line( + aes(colour = stat) + ) + +test_that("keys_near returns a similar plot", { + vdiffr::expect_doppelganger( + "stat_plot", + plot_stat + ) +}) \ No newline at end of file