From d75476bc3292839445e6f7bb4818dd464c5fc5dd Mon Sep 17 00:00:00 2001 From: Sam Abbott Date: Fri, 4 Feb 2022 17:27:44 +0000 Subject: [PATCH] fix fill_empty_dates_with_na test --- tests/testthat/test-processing.R | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/testthat/test-processing.R b/tests/testthat/test-processing.R index c8df2f39..d612109b 100644 --- a/tests/testthat/test-processing.R +++ b/tests/testthat/test-processing.R @@ -82,9 +82,12 @@ test_that("fill_empty_dates_with_na fills empty dates with NA", { # with NA in cases) expected_data <- expected_data %>% dplyr::group_by(, level_1_region, level_1_region_code) - + partial_data <- expected_data[-c(6:9), ] - expect_equal(fill_empty_dates_with_na(partial_data), expected_data) + expect_equal( + fill_empty_dates_with_na(partial_data), + dplyr::arrange(expected_data, level_1_region, date) + ) expected_data <- dplyr::mutate( expected_data, level_2_region = level_1_region, @@ -95,7 +98,10 @@ test_that("fill_empty_dates_with_na fills empty dates with NA", { level_1_region, level_1_region_code, cases ) partial_data <- expected_data[-c(6:9), ] - expect_equal(fill_empty_dates_with_na(partial_data), expected_data) + expect_equal( + fill_empty_dates_with_na(partial_data), + dplyr::arrange(expected_data, level_1_region, date) + ) }) test_that("complete_cumulative_columns works", {