Added operate() methods and tests for TimePicker widget

Added operate() methods and tests for TimePicker widget

#383 in iced-rs/iced_aw — merged 2025-12-28

Changes

TimePicker Integration Testing Support:

  • Implemented operate() method in src/widget/time_picker.rs to delegate to underlay widget
  • Implemented operate() method in src/widget/overlay/time_picker.rs to expose:
    • Digital clock elements (hour, minute, second, period indicators)
    • Cancel and submit buttons
    • Full widget tree structure for test interaction

TimePicker Integration Tests (tests/time_picker_integration_tests.rs - 19 tests):

  • Underlay button functionality and picker visibility
  • Hour/minute/second increment/decrement via UI interactions
  • Time boundary wrapping (23:59→00:00, etc.)
  • 12h/24h format display and AM/PM indicators
  • Cancel and submit button workflows
  • Keyboard navigation
  • Complete user workflows (adjust time, submit, etc.)

TimePicker Unit Tests (41 new tests):

  • src/widget/time_picker.rs (22 tests):

  • State creation and management

  • TimePicker widget construction and builder methods

  • Time type conversions (12h/24h, noon/midnight edge cases)

  • Widget trait implementations

  • src/widget/overlay/time_picker.rs (19 tests):

  • Overlay state initialization

  • Focus navigation with/without seconds display

  • ClockDragged and Focus enum behavior

  • Overlay button structure

# Widget unit tests
cargo test widget::time_picker

# Overlay unit tests
cargo test widget::overlay::time_picker

# Integration tests (using iced_test simulator)
cargo test --test time_picker_integration_tests

Last updated 2026-05-14