test_that("turbo_listener() works", {
script <- expect_class(
turbo_listener(
event = "before-visit",
code = "event.preventDefault();"
),
"shiny.tag"
)
expect_equal(script$name, "script")
})
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.