automated tests

Closes #3581728

● All 52 tests pass (80 assertions). Here's a summary of what was created:

7 test files, all under web/modules/composer/queue_stats/test/src/Unit/:

  1. MonitoredQueueTest (10 tests) — verifies the decorator proxies correctly, dispatches the right events on claim/delete/release, skips events when appropriate (failed claim, failed release), and handles garbage collection conditionally.
  2. ProcessingRateTest (6 tests) — covers rate calculation from completion timestamps, negative rate protection for parallel processing, formatValue scaling (items/second vs items/minute), reset, and event subscriptions.
  3. ProcessingTimeTest (8 tests) — covers start/completion tracking per item_id, duration calculation, ignoring completions without a start, zero-duration protection, independent tracking of multiple concurrent items, date formatting delegation, and reset.
  4. QueueTimeTest (6 tests) — covers wait time calculation from item->created, EMA averaging across multiple items, date formatting, and reset.
  5. EstimatedTimeToFinishTest (5 tests) — covers the numberOfItems / processingRate calculation, division-by-zero guard, empty queue case, and date formatting.
  6. QueueItemEventTest (2 tests) — verifies constructor/getter round-trip and event constant string values.
  7. NumItemsTest (4 tests) — covers getValue delegation, getLabel, formatValue passthrough, and no-op reset.

Plus the existing ExponentialMovingAverageTest (4 tests) was already there.

Merge request reports

Loading