tests/testthat/test-button.R

context("button")

test_that("throws error", {
  expect_error(bs_button("foo", button_type = "bar"))
})

button <- bs_button("Click me", button_type = "primary", button_size = "small")

test_that("button works", {
  expect_identical(
    .tag_validate(
      button,
      name = "button",
      class = "btn btn-primary btn-sm"
    ),
    button
  )
  expect_identical(
    "Click me",
    button$children[[1]]
  )
})
ijlyttle/bsplus documentation built on Nov. 15, 2022, 2:31 a.m.