tests/testthat/test-input-icon.R

context("input-icon")


test_that("textInputIcon works", {

  tag <- textInputIcon(
    inputId = "ID",
    label = "With an icon",
    icon = shiny::icon("circle-user")
  )

  expect_is(tag, "shiny.tag")

})


test_that("textInputIcon works with list", {

  tag <- textInputIcon(
    inputId = "ID",
    label = "With an icon",
    icon = list(shiny::icon("envelope"), "@mail.com"),
    size = "lg"
  )

  expect_is(tag, "shiny.tag")

})



test_that("textInputIcon works", {

  tag <- numericInputIcon(
    inputId = "ID",
    label = "With an icon",
    value = 0,
    icon = shiny::icon("circle-user")
  )

  expect_is(tag, "shiny.tag")

})


test_that("textInputIcon works with list", {

  tag <- numericInputIcon(
    inputId = "ID",
    label = "With an icon",
    value = 0,
    icon = list(shiny::icon("envelope"), "@mail.com"),
    size = "lg"
  )

  expect_is(tag, "shiny.tag")

})

Try the shinyWidgets package in your browser

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

shinyWidgets documentation built on Aug. 30, 2023, 5:17 p.m.