tests/testthat/test-has_req_aes.R

test_that("has_req_aes() detects when a geom has required aesthetics", {
  expect_false(has_req_aes(geom_text()))
  expect_false(has_req_aes(geom_text(aes(x = 1, y = 2))))

  expect_true(
    has_req_aes(
      geom_text(aes(x = 1, y = 2, label = "something"))
    )
  )
})
MattCowgill/ggannotate documentation built on Oct. 9, 2021, 11:03 p.m.