# =============================================================================
# inputs
# =============================================================================
# -----------------------------------------------------------------------------
# start date is valid
# -----------------------------------------------------------------------------
test_that("Error if start date invalid", {
expect_error(
get_last_sync_dates(start = "2021-02-99", end = "2021-03-31")
)
})
# -----------------------------------------------------------------------------
# end date is valid
# -----------------------------------------------------------------------------
test_that("Error if end date invalid", {
expect_error(
get_last_sync_dates(start = "2021-02-01", end = "2021-03-32")
)
})
# =============================================================================
# outputs
# =============================================================================
# -----------------------------------------------------------------------------
# df with expected columns
# -----------------------------------------------------------------------------
test_that("Returns df with expected columns", {
x <- suppressMessages(
get_last_sync_dates(
start = "2021-02-01",
end = "2021-03-31"
)
)
expect_s3_class(x, c("tbl_df","tbl","data.frame"))
expect_named(x, c("UserId", "last_sync_date"),
ignore.order = TRUE)
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.