insightsengineering / teal.modules.hermes

RNA-seq analysis modules to add to a teal application
https://insightsengineering.github.io/teal.modules.hermes/
Other
7 stars 1 forks source link

Unable to find input binding for element #393

Open BFalquet opened 1 month ago

BFalquet commented 1 month ago

What happened?

The package is working but when trying to run a shinytest that involves using filters on the right hand side panel there is an issue: Example with the pca.app in test/testthat/test-pca.R:

  app <- AppDriver$new(
    app_dir = test_path("pca"),
    name = "pca",
    variant = platform_variant(),
    load_timeout = 300000,
    seed = default_app_seed
  )
ns2 <- NS("teal-main_ui-filter_panel")
 app$set_inputs(!!ns2("add-MAE-hd1-row_to_add") := "chromosome_name")

Error received while setting inputs: Unable to find input binding for element with id teal-main_ui-filter_panel-add-MAE-hd1-row_to_add
    ▆
 1. └─app$set_inputs(`:=`(!!ns2("add-MAE-hd1-row_to_add"), "chromosome_name"))
 2.   └─shinytest2:::app_set_inputs(...)

I tried to interact with the filtering panes with:

app$click("teal-teal_modules-pca-filter_panel-filters-available_filters-show")
app$set_inputs(`teal-teal_modules-pca-filter_panel-filters-MAE-MAE-hd1-row_to_add` = "chromosome")
app$set_inputs(`teal-teal_modules-pca-filter_panel-filters-MAE-hd1-MAE_chromosome_hd1_subset-inputs-selection` = character(0))

(I used shinytest2::record_test() to figure out the names of the namespace) but the selection is not updated. It feels like I am missing one step to validate the selection.

image

any idea @donyunardi @dawid ?

sessionInfo()

No response

Relevant log output

No response

Code of Conduct

Contribution Guidelines

Security Policy

Dawid commented 1 month ago

@BFalquet no idea whatsoever... But I have a pic of cute cat - hope that helps! cute-cat

donyunardi commented 1 month ago

tagging @m7pr who is closer to the implementation of shinytest2 in our packages.

@m7pr could you please assess this?

donyunardi commented 1 month ago

Hi @BFalquet

We made some changes to the UI recently so we just need to adjust these tests.

app$set_inputs(teal-teal_modules-pca-filter_panel-filters-MAE-MAE-hd1-row_to_add = "chromosome")

Yes, this is the correct namespace to select chromosome as the drop down value for hd1 in the filter panel.

app$set_inputs(teal-teal_modules-pca-filter_panel-filters-MAE-hd1-MAE_chromosome_hd1_subset-inputs-selection = character(0))

If the purpose of this line is to remove the selection, then we have to click the x button on the filter card and the namespace for this is teal-teal_modules-pca-filter_panel-filters-MAE-hd1-MAE_chromosome_hd1_subset-remove.

app$click("teal-teal_modules-pca-filter_panel-filters-MAE-hd1-MAE_chromosome_hd1_subset-remove")

You can do app$view() to see the state of the browser and look around to find the correct namespace. Please make sure you're using teal on main version.