Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to find input binding for element #393

Open
3 tasks done
BFalquet opened this issue Sep 18, 2024 · 3 comments
Open
3 tasks done

Unable to find input binding for element #393

BFalquet opened this issue Sep 18, 2024 · 3 comments
Assignees
Labels
bug Something isn't working

Comments

@BFalquet
Copy link
Contributor

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

  • I agree to follow this project's Code of Conduct.

Contribution Guidelines

  • I agree to follow this project's Contribution Guidelines.

Security Policy

  • I agree to follow this project's Security Policy.
@BFalquet BFalquet added the bug Something isn't working label Sep 18, 2024
@Dawid
Copy link

Dawid commented Sep 18, 2024

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

@donyunardi
Copy link
Contributor

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

@m7pr could you please assess this?

@m7pr m7pr self-assigned this Sep 19, 2024
@donyunardi
Copy link
Contributor

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants