Testing update for color_picker
Testing update for color_picker
#380 in iced-rs/iced_aw — merged 2025-12-28
The ColorPicker widget lacked operate() implementations, preventing iced_test from discovering and interacting with its buttons.
Remediation
- Added
operate()method to ColorPicker widget - Added
operate()method to ColorPickerOverlay - Rewrote integration tests** (tests/color_picker_integration_tests.rs)
What I Didn't Do
I didn't make the 6 color manipulation areas testable (HSV canvas, RGBA sliders). These are custom-drawn canvas elements, not widget components. The color sliders use custom canvas drawing and direct event handling, not the widget tree. Making them testable would require either:
- Refactoring to use Slider widgets (breaking change)
- Creating custom operation types for canvas interactions (complex)
It seems to me that the cost/benefit doesn't justify it - the critical user actions (opening picker, accepting/canceling) are now testable.
Impact
- No breaking changes - purely additive internal implementations
Last updated 2026-05-14
Links to this note
Credits
Merged pull requests, newest first.