Skip to content

Commit

Permalink
fix(test-duplicate-ids): Check for duplicates instead of app start fa…
Browse files Browse the repository at this point in the history
…ilure (#384)
  • Loading branch information
gadenbuie authored Apr 12, 2024
1 parent 436535d commit 967b669
Showing 1 changed file with 10 additions and 5 deletions.
15 changes: 10 additions & 5 deletions tests/testthat/test-app-duplicate-ids.R
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ test_that("Duplicate input/output ids are found", {



test_that("Duplicate output ids are found", {
test_that("Duplicate custom output ids are found", {

shiny_app <- shinyApp(
ui = fluidPage(
Expand All @@ -74,7 +74,7 @@ test_that("Duplicate output ids are found", {
})


test_that("Duplicate input ids are found", {
test_that("Duplicate shiny output ids are found", {
shiny_app <- shinyApp(
ui = fluidPage(
# Duplicate output IDs causes failure to load application
Expand All @@ -87,8 +87,13 @@ test_that("Duplicate input ids are found", {
}
)

expect_error(
AppDriver$new(shiny_app, load_timeout = 2000),
"Shiny app did not become stable"
expect_warning(
app <- AppDriver$new(shiny_app, check_names = TRUE),
"html"
)

expect_failure(
app$expect_unique_names(),
"html"
)
})

0 comments on commit 967b669

Please sign in to comment.