Fix failing integration test#88
Conversation
Code Coverage SummaryDiff against mainResults for commit: 2c70921 Minimum allowed coverage is ♻️ This comment has been updated with latest results |
Unit Tests Summary 1 files 11 suites 19s ⏱️ Results for commit 2c70921. ♻️ This comment has been updated with latest results. |
Unit Test Performance DifferenceAdditional test case details
Results for commit 5dbbb97 ♻️ This comment has been updated with latest results. |
| } | ||
|
|
||
| # Badge label may prefix variables with dataset (e.g. "ADLB BNRIND"). | ||
| .teal_picks_strip_ds_prefix_vec <- function(x) { # nolint: object_length_linter. |
There was a problem hiding this comment.
this is not used in this package yet
| # Wait until a Shiny input has a non-empty DOM value (e.g. after `updateSelectInput`). | ||
| # Caller must supply the full Shiny input ID (without leading "#"). | ||
| # Uses one [`AppDriver$wait_for_js()`] instead of polling `wait_for_idle()`. | ||
| wait_until_nonempty_active_module_input <- function(app_driver, input_id) { # nolint: object_length_linter. |
There was a problem hiding this comment.
this is not used in this package yet
|
Hi, my initial intention was to port every testing function developed in tmc to be maintained in teal.picks and then reused in tmc and other module packages. That is why I copied the full script. But let's go step by step, I have removed the non used functions. Most of them are already used only for the tests in teal.picks |
averissimo
left a comment
There was a problem hiding this comment.
Looks good overall, but maybe we should move the new functions to the R folder (either as private or exported).
This way we can re-use them in other packages without too much repeated code.
Left some other housecleaning comments as well ;)
| # When `singleton_as_bare_string` is `TRUE` and `length(val) == 1L`, return a single JSON string | ||
| # token (e.g. `"foo"`). Otherwise return a JSON array (`[]`, `["a"]`, or `["a","b"]`). The | ||
| # always-array form is used where `const arr = ...` must remain an array (DOM sync script). | ||
| .teal_picks_js_json_collection_literal <- function(val, singleton_as_bare_string) { # nolint: object_length_linter. |
There was a problem hiding this comment.
Only used in function below, can you add a default parameter for the second parameter and replace the occurrences of teal_picks_js_string_array_literal with this one?
There was a problem hiding this comment.
If we add this functions here we should make them available in the R/ folder instead.
This would reduce redundant code in tmc/tmg/...
I think we can export the JS API with a app_driver or shinytest2 prefix. Or other naming convention
app_driver_get_teal_picks_slotapp_driver_set_teal_picks_slotapp_driver_click_teal_picks_summary_badge
Is any other function being used?
There was a problem hiding this comment.
Maybe add a checkmate::assert_class(app_driver, "AppDriver") to those functions just in case
There was a problem hiding this comment.
I agree that adding them to the R folder is the best idea. I suggest not to export them but to export them using getFromNamespace
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
Co-authored-by: André Veríssimo <211358+averissimo@users.noreply.github.com>
There was a failing integration test in the badge test.
To fix it, it was changed the way we click the input and check if the expected content is there or not. I reused the testing functions of tmc. Actually, we can keep them on teal.picks and reuse them in modules packages. In that case, we probably would need to place the function within R folder.
Please run the test:
testthat::test_file("tests/testthat/test-badge_dropdown.R")To make it sure now the test are passed.