tests/testthat/test_eq_create_label.R

context("Checking Labels in Leaflet Map")


df_clean <- eq_clean_data()

obj_out <- df_clean %>%
        dplyr::filter(COUNTRY %in% c('USA', 'PERU')) %>%
        dplyr::filter(date > '2000-01-01') %>%
        dplyr::mutate(popup_text = eq_create_label(.))


ncol_df_clean <- ncol(df_clean)
ncol_obj_out <- ncol(obj_out)

test_that("Checking Labels of Leaflet Map ?", {
        expect_is(obj_out$popup_text, "character")
        expect_equal(ncol_df_clean, ncol_obj_out - 1)
})
Brunobt80/rPkgNOAADataset documentation built on May 20, 2019, 12:57 a.m.