Skip to content

Commit

Permalink
Add test for generating input time seris plot when no vls data present
Browse files Browse the repository at this point in the history
  • Loading branch information
r-ash committed Nov 11, 2021
1 parent bc8ea2c commit b1f6e14
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions tests/testthat/test-endpoints-chart-data.R
Expand Up @@ -81,6 +81,23 @@ test_that("endpoint_input_time_series_plot works with programme data", {
c("plot_type", "area_level", "quarter"))
})

test_that("endpoint_input_time_series_plot works without vls indicators", {
endpoint <- endpoint_input_time_series_plot()
input <- input_time_series_request(
file.path("testdata", "programme_no_vls.csv"),
"programme",
file.path("testdata", "malawi.geojson"))
res <- endpoint$run("programme", input)
expect_equal(res$status_code, 200)
body <- jsonlite::fromJSON(res$body)
expect_equal(body$status, "success")
expect_null(body$errors)
expect_equal(names(body$data), c("data", "metadata"))
expect_true(nrow(body$data$data) > 100)
expect_equal(names(body$data$metadata$defaults$selected_filter_options),
c("plot_type", "area_level", "quarter"))
})

test_that("endpoint_input_time_series_plot works with anc data", {
endpoint <- endpoint_input_time_series_plot()
input <- input_time_series_request(
Expand Down

0 comments on commit b1f6e14

Please sign in to comment.