tests/testthat/test-link.R

context("link input")

test_that("id argument", {
  expect_error(linkInput(), "please specify `id`")
  expect_error(linkInput(id = 2, "TEXT"))

  expect_silent(linkInput(id = "ID", "TEXT"))
})

test_that("download argument", {
  expect_true(
    tag_name_is(linkInput(id = "ID", "TEXT", download = FALSE), "button")
  )

  expect_true(
    tag_name_is(linkInput(id = "ID", "TEXT", download = TRUE), "a")
  )
})

test_that("has dependencies", {
  expect_dependencies(linkInput("ID", "LABEL"))
})

Try the yonder package in your browser

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

yonder documentation built on Jan. 11, 2020, 9:35 a.m.