-
Notifications
You must be signed in to change notification settings - Fork 7
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
Conversation
inst/apps/315-bslib-input-switch/tests/testthat/test-315-bslib-input-switch.R
Outdated
Show resolved
Hide resolved
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" | ||
) |
There was a problem hiding this comment.
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.
* 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)
Adds tests around
bslib::input_switch()
and update methodstoggle_sidebar()
alias and addtoggle_switch()
bslib#676