Skip to content

Commit

Permalink
fix test for old data and add new test
Browse files Browse the repository at this point in the history
  • Loading branch information
azimov committed Sep 26, 2023
1 parent bba449f commit 20bbac3
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion tests/testthat/test-helpers-sccsPlots.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ test_that("convert to dates", {
testthat::expect_equal(as.character(convertToEndDate(2020,12)), "2020-12-31")
})

test_that("plotTimeTrend", {
# Note - this is the old plot
test_that("plotTimeTrendStability", {
df <- data.frame(
calendarYear = c(2011,2012),
calendarMonth = c(1,1),
Expand All @@ -15,11 +16,24 @@ test_that("plotTimeTrend", {
adjustedRate = runif(2),
stable = rep(1,2)
)
res <- plotTimeTrendStability(df)
testthat::expect_is(res, "ggplot")
})
# New plot
test_that("plotTimeTrend", {
df <- data.frame(
calendarYear = c(2011,2012),
calendarMonth = c(1,1),
ratio = runif(2),
observedSubjects = rep(100,2),
adjustedRatio = runif(2)
)
res <- plotTimeTrend(df)
testthat::expect_is(res, "ggplot")
})



test_that("plotTimeToEventSccs", {

df <- data.frame(
Expand Down

0 comments on commit 20bbac3

Please sign in to comment.