tests/testthat/test-create_rank.R

test_that("create_rank handles different return types", {
  # Test table return
  result_table <- sq_data %>%
    create_rank(hrvar = "Organization",
                metric = "Email_hours",
                return = "table")
  expect_s3_class(result_table, "data.frame")

  # Test plot return
  result_plot <- sq_data %>%
    create_rank(hrvar = "Organization",
                metric = "Email_hours",
                return = "plot")
  expect_s3_class(result_plot, "ggplot")
})

# Test plot return with simple mode
test_that("create_rank with different modes", {
  result <- sq_data %>%
    create_rank(
      hrvar = "Organization",
      metric = "Email_hours",
      mode = "simple",
      return = "plot"
    )
  expect_s3_class(result, "ggplot")
})

Try the wpa package in your browser

Any scripts or data that you put into this service are public.

wpa documentation built on Aug. 26, 2025, 5:07 p.m.