Update tests to not make strong assumptions about actionButton()
's HTML markup
#1212
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Hello, I'm a core contributor to Shiny, and this PR is in anticipation for rstudio/shiny#4249, where we plan on making changes to the HTML markup that
actionButton()
produces, which will break these tests ofundisplay()
's logic.I've made a minimal change to still test the logic you're aiming to test, but without making such strong assumptions about the markup that
actionButton()
generates. It would be great if golem could make a more extensive pass through tests (and utility functions) to not be so tightly coupled with Shiny's HTML markup generation. Some tools you can use to combat this include{htmltools}
'stagGetAttribute()
,tagSetAttributes()
,tagQuery()
, etc. You may also consider snapshot testing for tests that truly do want to make assumptions about markup generation beyond your control.