Skip to content

Update tests to not make strong assumptions about actionButton()'s HTML markup #1212

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

Merged
merged 1 commit into from
Jul 2, 2025

Conversation

cpsievert
Copy link
Contributor

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 of undisplay()'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}'s tagGetAttribute(), tagSetAttributes(), tagQuery(), etc. You may also consider snapshot testing for tests that truly do want to make assumptions about markup generation beyond your control.

@ColinFay ColinFay merged commit ab09e64 into ThinkR-open:master Jul 2, 2025
7 checks passed
@ColinFay
Copy link
Member

ColinFay commented Jul 2, 2025

Thanks a lot 🙏

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