Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions R/tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,17 @@ ui_distribution <- function(id, ...) {
tags$h3("Statistics Table"),
DT::dataTableOutput(ns("summary_table")),
tags$h3("Tests"),
DT::dataTableOutput(ns("t_stats"))
conditionalPanel(
sprintf("input['%s'].length === 0", ns("dist_tests")),
div(
id = ns("please_select_a_test"),
"Please select a test"
)
),
conditionalPanel(
sprintf("input['%s'].length > 0", ns("dist_tests")),
DT::dataTableOutput(ns("t_stats"))
)
),
encoding = tags$div(
### Reporter
Expand Down Expand Up @@ -1101,7 +1111,7 @@ srv_distribution <- function(id,
dist_tests <- input$dist_tests
t_dist <- input$t_dist

validate(need(dist_tests, "Please select a test"))
req(dist_tests)

teal::validate_inputs(iv_dist)

Expand Down
4 changes: 1 addition & 3 deletions tests/testthat/test-shinytest2-tm_g_distribution.R
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ testthat::test_that("e2e - tm_g_distribution: Histogram encoding inputs produce
app_driver <- app_driver_tm_g_distribution()

app_driver$set_active_module_input("main_type", "Density")
app_driver$expect_validation_error() # test needs to be updated to remove validation error
app_driver$expect_no_validation_error()
app_driver$set_active_module_input("dist_tests", "Shapiro-Wilk")

# Encodings in the Histogram tab
Expand Down Expand Up @@ -112,8 +112,6 @@ testthat::test_that("e2e - tm_g_distribution: QQ plot encoding inputs produce ou

# Encodings in the QQplot tab
app_driver$set_active_module_input("main_type", "Density")
app_driver$expect_validation_error() # test needs to be updated to remove validation error
app_driver$set_active_module_input("dist_tests", "Shapiro-Wilk")
app_driver$expect_no_validation_error()

app_driver$set_active_module_input("tabs", "QQplot")
Expand Down
Loading