Skip to content

Conversation

InesaFitsner
Copy link
Contributor

@InesaFitsner InesaFitsner commented Sep 10, 2025

Description

Test Code

# Test code for the review of this PR

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Checklist

  • I signed the CLA.
  • My code follows the style guidelines of this project
  • I have performed a self-review of my own code
  • I have commented my code, particularly in hard-to-understand areas
  • My changes generate no new warnings
  • New and existing tests pass locally with my changes
  • I have made corresponding changes to the documentation (if applicable)

Screenshots

Additional details

Summary by Sourcery

Add comprehensive integration tests for widget controls and themes, unify theme API attributes, and enhance theme parsing and control implementations to support new styling options

Enhancements:

  • Introduce pytest_asyncio fixtures and loop_scope adjustments to isolate flet_app instances for each test
  • Add integration tests for ListTile, FloatingActionButton, DataTable, Dropdown, ExpansionTile, Divider, and various button controls under normal and themed states
  • Create new theme-specific integration tests for FloatingActionButton, ListTile, ExpansionTile, Button, FilledButton, IconButton, TextButton, and OutlinedButton
  • Refactor Python Theme dataclass by renaming and consolidating attributes (e.g. extended_text_style→text_style, extended_icon_label_spacing→icon_label_spacing, min_tile_height→min_height) and enrich docstrings
  • Extend Flutter theme parsing logic and Dart control implementations to apply new theme properties (color_scheme_seed default, divider_theme, dropdown_menu_theme, splash_color, hover_color, etc.)

InesaFitsner and others added 30 commits August 25, 2025 11:10
Improved DataTable decoration handling in datatable.dart by using type-safe casting and fallback logic. Updated integration tests to use per-test app instances, added a new themed DataTable test, and replaced golden images for macOS DataTable screenshots.
Simplified theme color logic in Dart by removing primarySwatch and related properties. Updated Python Theme dataclass to remove primary_swatch and added documentation for color_scheme_seed.
Refactored Dart theme parsing to use a local colorScheme variable and set shadowColor from colorScheme. Improved Python Theme class documentation for color_scheme and chip_theme, and removed unused color attributes.
Refactored Dart theme parsing to use DividerThemeData for divider color and theme assignment. Added docstrings to Python Theme class for divider_theme, clarifying its usage and affected widgets.
Updated integration tests for Divider and DataTable to cover theme properties and added new golden images for Divider tests. Also removed unused divider_color from Theme.
Set the 'text' property to 'Select a color' for the dropdown in the test_dropdown.py integration test. Updated golden images to reflect this UI change.
Updated dropdown integration tests to use function-scoped async fixtures and split basic and theme tests. Added new golden images for macOS dropdown control states. Also removed redundant screenshot enabling in data table and divider tests.
Added support for specifying a custom MenuStyle for Dropdown controls, allowing configuration of background color, elevation, and width. Updated theme parsing to use 'dropdown_theme' for DropdownMenuTheme. Adjusted integration test golden images to reflect new styling options. Improved documentation for menu_style in Python Dropdown and DropdownTheme classes.
Eliminated appending the Tester service to the page's services list in FletTestApp. This may be part of a refactor or cleanup to simplify test app setup.
Introduces an integration test for button theme customization, including a golden image for macOS. Also adds a docstring to the Theme.button_theme property to clarify its purpose.
Uncommented the text_style property in the button theme integration test and updated the golden image to reflect the new button appearance.
Introduces an integration test for OutlinedButton theme, including a golden image for macOS. Also adds a docstring to the outlined_button_theme property in Theme to clarify its purpose.
Introduced a new integration test for TextButton theme, including a golden image for macOS. Added a docstring to the Theme class for text_button_theme to clarify its purpose. Minor comment update in button theme test for color usage.
Introduces an integration test for FilledButton theme customization, including a golden image for macOS. Also adds a docstring to the filled_button_theme property in Theme to clarify its purpose.
Introduces icon_button_theme to the Theme class for customizing IconButton appearance. Adds an integration test and golden image to verify IconButton theming on macOS.
Renamed and added new golden images for ExpansionTile tests on macOS, updated test function names and added a new test for ExpansionTile properties. Also improved documentation for expansion_tile_theme in Theme class.
Commented out the 'leading' icon, changed 'affinity' from TRAILING to LEADING, and updated the corresponding golden image for the ExpansionTile properties test on macOS.
Replaces the properties1.png screenshot with closed.png and expanded.png for macOS golden images. Refactors test_expansion_tile.py to use per-test flet_app instances, removes the properties1 test, and adds a new expanded state test with updated screenshot logic.
Renamed 'closed' screenshot to 'collapsed' in ExpansionTile tests for consistency. Added new integration tests and golden images for ExpansionTileTheme on macOS, including both collapsed and expanded states. Fixed clipBehavior parsing in ExpansionTileControl.
The text_style property was commented out in button theme integration tests, due to issue #5620. Corresponding golden images were updated to reflect this change.
Added new integration tests for FloatingActionButton with center top and end top locations, including corresponding golden images. Improved documentation for floating_action_button_theme in Theme to clarify its purpose. Renamed basic screenshot for consistency.
Introduces new integration tests for FloatingActionButton properties, including visual states for elevation, focus, and disabled. Adds corresponding golden images for macOS to validate screenshot outputs.
Introduced a new integration test to verify the hover state of FloatingActionButton on macOS, including screenshot comparison. Additional properties related to hover and feedback were set for more comprehensive coverage.
Renamed 'extended_text_style' to 'text_style' and 'extended_icon_label_spacing' to 'icon_label_spacing' in both Dart and Python implementations for consistency. Updated related documentation and integration tests, and added golden images for macOS FloatingActionButton theme states.
Renamed and expanded ListTile integration tests for better coverage, including new tests for selected, focus, hover, and disabled states. Updated and added corresponding golden images for macOS. Improved docstrings in FloatingActionButtonTheme and Theme to clarify icon and content terminology and added missing docstrings for theme properties.
Expanded ListTile property coverage in integration tests by adding cases for custom shapes, dense tiles, and content padding. Updated golden images to reflect new test scenarios and improved property combinations for more comprehensive visual validation.
Replaced 'bgcolor_activated' with 'splash_color' in ListTile control for both Dart and Python implementations to improve clarity and consistency. Updated integration tests to cover additional ListTile properties and added new golden images for toggle input scenarios.
Split the ListTile properties test into two separate tests, moving several property checks to a new test_properties2 and updating screenshot references to properties_3_normal and properties_3_hover. Added a new golden image and renamed existing ones to match the new test structure.
Refactored ListTile hover color documentation to clarify it only applies when `toggle_inputs` is True. Updated and replaced golden test images for macOS ListTile to reflect new toggle input states and removed obsolete images.
Changed several ListTile properties in Python and Dart from default values to Optional types to allow for unset states. Renamed 'min_tile_height' to 'min_height' in ListTileTheme for consistency, and updated related parsing logic in Dart.
Introduces a new integration test for ListTile theme customization in Flet, including a golden screenshot for macOS. The test verifies various theme properties and ListTile configurations to ensure correct rendering.
Copy link
Contributor

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We've reviewed this pull request using the Sourcery rules engine

@FeodorFitsner FeodorFitsner merged commit cbdae3a into main Sep 10, 2025
6 checks passed
@FeodorFitsner FeodorFitsner deleted the inesa/integration-tests-p5 branch September 10, 2025 17:14
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