diff --git a/tests/testthat/_snaps/derivatives/draw-issue-57-derivatives-for-factor-by.svg b/tests/testthat/_snaps/derivatives/draw-issue-57-derivatives-for-factor-by.svg new file mode 100644 index 000000000..10b1f47ae --- /dev/null +++ b/tests/testthat/_snaps/derivatives/draw-issue-57-derivatives-for-factor-by.svg @@ -0,0 +1,99 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +0.1 +0.2 +0.3 + + + + + + + + +0 +5 +10 +15 +20 +t +Derivative +s(t,unit) +draw issue 57 derivatives for factor by + + diff --git a/tests/testthat/test-derivatives.R b/tests/testthat/test-derivatives.R index 061c773ad..22b051cc3 100644 --- a/tests/testthat/test-derivatives.R +++ b/tests/testthat/test-derivatives.R @@ -463,12 +463,12 @@ test_that("derivatives() works for fs smooths issue 57", { data = d, method = "REML" ) - expect_silent(d <- derivatives(m_logistic_growth)) - expect_s3_class(d, "derivatives") - expect_s3_class(d, "tbl_df") - expect_named(d, c(deriv_nms, "t")) - ## plt <- draw(d) # FIXME: need to update draw(d) so it works with fs smooths - ## expect_doppelganger("draw issue 57 derivatives for factor by", plt) + expect_silent(fd <- derivatives(m_logistic_growth)) + expect_s3_class(fd, "derivatives") + expect_s3_class(fd, "tbl_df") + expect_named(fd, c(deriv_nms, "t", "unit")) + plt <- draw(fd) # FIXME: need to update draw(d) so it works with fs smooths + expect_doppelganger("draw issue 57 derivatives for factor by", plt) }) ## tests for by variables & simultaneous intervals #102