tests/testthat/test_geom_timeline_label.R

context('geom_timeline_label')

test_that('geom_timeline_label', {
  
  plot1 <- NOAA_quakes%>%eq_clean_data()%>%
    dplyr::filter(COUNTRY %in% c('MEXICO','JAPAN')) %>%
    dplyr::filter(DATE > '2010-01-01') %>%
    ggplot2::ggplot() +
    geom_timeline(aes(x = DATE, y = COUNTRY, size = as.numeric(EQ_PRIMARY),
                      color = as.numeric(TOTAL_DEATHS)))
  
  expect_length(unique(layer_data(plot1)$y),2)
  expect_s3_class(plot1, 'ggplot')

  
})
jyjek/jyjekNOAA documentation built on May 7, 2019, 10:52 p.m.