chore: add tests for button inherited text style#1322
Conversation
Added (failing) tests covering buttons using inherited text style.
There was a problem hiding this comment.
Code Review
This pull request adds new test cases to test/button_test.dart to verify that Button and FilledButton correctly apply default foreground colors and inherited text styles from the theme. It also introduces a _renderedTextStyle helper function to extract styles during testing. Feedback was provided regarding the fragility of the _renderedTextStyle helper, which may fail if a button contains multiple RichText descendants (e.g., an icon and text).
|
/gemini review |
There was a problem hiding this comment.
Code Review
This pull request updates the base button state to resolve the text color using the style's textStyle color, falling back to the resolved foreground color if not specified. It also adds comprehensive widget tests to verify this behavior under various configurations. The feedback suggests using const for ButtonThemeData in the test file to align with Dart best practices and optimize performance.
Fixes #1318.
Pre-launch Checklist
CHANGELOG.mdwith my changes