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

Add 315-bslib-input-switch #202

Merged
merged 5 commits into from
Jul 28, 2023
Merged

Add 315-bslib-input-switch #202

merged 5 commits into from
Jul 28, 2023

Conversation

gadenbuie
Copy link
Member

Adds tests around bslib::input_switch() and update methods

@gadenbuie gadenbuie requested review from cpsievert and schloerke July 26, 2023 13:57
Comment on lines +78 to +90
app$
set_inputs(smart_punct_label = "Awesome Punctuation")$
wait_for_js(
"document
.querySelector('label[for=\"smart_punctuation\"]')
.innerText
.includes('Awesome')"
)

expect_equal(
app$get_js('document.querySelector("label[for=\\"smart_punctuation\\"]").innerText'),
"Awesome Punctuation"
)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@schloerke Does this seem like the right approach? Basically, input$smart_punct_label is passed to update_switch(label = input$smart_punct_label), and I want to check that the label was actually updated.

I originally had something like

app$set_inputs(smart_punct_label = "Awesome Punctuation")
app$get_text('label[for="smart_punctuation"]')
# test the text from above

but I saw a couple failures of this test that were likely race-condition driven where $get_text() would resolve before the label was actually updated.

@gadenbuie gadenbuie merged commit e2153a8 into main Jul 28, 2023
@gadenbuie gadenbuie deleted the input-switch branch July 28, 2023 14:55
schloerke added a commit that referenced this pull request Mar 14, 2024
* main:
  Deploy connect apps to rsc.radixu.com (#209)
  Generate apps deps (GitHub Actions)
  Approve slightly darker text input selection
  Add 315-bslib-input-switch (#202)
  Also approve sysinfo changes
  Add new 314 baseline
  Approve slightly darker text input selection; version bumps
  Generate apps deps (GitHub Actions)
  Add 314 - Unit tests for `bslib::tooltip()` (#194)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants