Skip to content

Commit

Permalink
Favor shinytest get_value over get_text.
Browse files Browse the repository at this point in the history
  • Loading branch information
ml-ebs-ext committed Jul 21, 2024
1 parent 7e3c45f commit 40611e7
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .git-blame-ignore-revs
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# Address styler complaints.
7e3c45ff68183e2e9984b7a099167a0deec69455
6 changes: 3 additions & 3 deletions tests/testthat/test-all.R
Original file line number Diff line number Diff line change
Expand Up @@ -107,18 +107,18 @@ test_that(
app$wait_for_idle()

# Check if the first patient was selected (initial state)
testthat::expect_equal(app$get_text("#mock_app-patient_selector"), "01-701-1015")
testthat::expect_equal(app$get_value(input = "mock_app-patient_selector"), "01-701-1015")

# Check if the first male patient was selected when filtered accordingly
app$set_inputs(`global_filter-SEX` = "M")
# assign pat_id only to suppress print
pat_id <- app$wait_for_value(input = "mock_app-patient_selector", ignore = list("01-701-1015"))
testthat::expect_equal(app$get_text("#mock_app-patient_selector"), "01-701-1023")
testthat::expect_equal(app$get_value(input = "mock_app-patient_selector"), "01-701-1023")

# Check if no patient is selected when filtered accordingly
app$set_inputs(`global_filter-SEX` = character(0))
app$wait_for_idle(2000)
testthat::expect_equal(app$get_text("#mock_app-patient_selector"), "")
testthat::expect_equal(app$get_value(input = "mock_app-patient_selector"), "")

app$stop()
}
Expand Down

0 comments on commit 40611e7

Please sign in to comment.