Files
AVSDevR.HTMLUtils/tests/testthat/test-htmlRemoveAttributes.R
Craig Williams 6d3843a92b Package with an initial set of functions added
NOTE: Not all tests have been written yet!
2026-01-22 15:59:54 +00:00

14 lines
396 B
R

test_that("remove existing attribute", {
x <- shiny::icon("wrench")
y <- "<i class=\"fas fa-wrench\" role=\"presentation\"></i>"
expect_equal(as.character(htmlRemoveAttributes(x, "aria-label")), y)
})
test_that("remove non-existing attribute does not fail", {
x <- shiny::icon("wrench")
expect_equal(
as.character(htmlRemoveAttributes(x, "aria-title")),
as.character(x)
)
})