Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Nov 14, 2024
1 parent 4a7b761 commit 3fd325b
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 17 deletions.
8 changes: 0 additions & 8 deletions tests/testthat/_snaps/module2app.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,14 +65,6 @@
<!--@generated-->
[1] "$bar\n[1] 1\n\n$zap\ncharacter(0)"

# works with S3-classed return

Code
driver$get_value(output = "inputs-eval")
Output
<!--@generated-->
[1] "$zap\n[1] \"<svg xmlns=\\\"http://www.w3.org/2000/svg\\\" viewBox=\\\"0 0 16 16\\\" class=\\\"bi bi-heart \\\" style=\\\"height:1em;width:1em;fill:currentColor;vertical-align:-0.125em;\\\" aria-hidden=\\\"true\\\" role=\\\"img\\\" ><path d=\\\"m8 2.748-.717-.737C5.6.281 2.514.878 1.4 3.053c-.523 1.023-.641 2.5.314 4.385.92 1.815 2.834 3.989 6.286 6.357 3.452-2.368 5.365-4.542 6.286-6.357.955-1.886.838-3.362.314-4.385C13.486.878 10.4.28 8.717 2.01L8 2.748zM8 15C-7.333 4.868 3.279-3.04 7.824 1.143c.06.055.119.112.176.171a3.12 3.12 0 0 1 .176-.17C12.72-3.042 23.333 4.867 8 15z\\\"></path></svg>\"\nattr(,\"html\")\n[1] TRUE\nattr(,\"browsable_html\")\n[1] TRUE"

# works with nested modules and deep returns

"$increment_by\n[1] 1\n\n$count_by\n[1] 2\n\n$a_non_reactive_return\n[1] \"just for testing\"\n\n$deeper_copy_of_increment_by\n$deeper_copy_of_increment_by$increment_by\n[1] 1\n"
Expand Down
16 changes: 7 additions & 9 deletions tests/testthat/test-module2app.R
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,14 @@ test_that("works with `shiny.tag` returns (workaround)", {
})
test_that("works with S3-classed return", {
skip_if_load_all2()
driver <- shinytest2::AppDriver$new(
module2app(
server_args = list(zap = shiny::reactive(bsicons::bs_icon("heart")))
expect_no_condition({
driver <- shinytest2::AppDriver$new(
module2app(
server_args = list(zap = shiny::reactive(bsicons::bs_icon("heart")))
)
)
)
withr::defer(driver$stop())
expect_snapshot(
driver$get_value(output = "inputs-eval"),
transform = purrr::compose(elf::transform_with_generated)
)
withr::defer(driver$stop())
})
})
test_that("works with nested modules and flat returns", {
shiny::testServer(
Expand Down

0 comments on commit 3fd325b

Please sign in to comment.