mirror of
https://github.com/home-assistant/iOS.git
synced 2026-02-03 18:11:40 -06:00
## Summary
Enhanced `testLoadContentHandlesActionsWithSamePosition` to verify that
Swift's stable sort preserves insertion order for actions with identical
position values. The test previously only checked that all items were
included but didn't validate ordering behavior.
Added assertions to explicitly verify the order matches insertion
sequence:
```swift
// Swift's stable sort should preserve insertion order for equal positions
#expect(sut.actions[0].ID == "action-1")
#expect(sut.actions[1].ID == "action-2")
#expect(sut.actions[2].ID == "action-3")
```
This ensures the test covers both inclusion and ordering guarantees when
`sorted(by: { $0.Position < $1.Position })` processes items with equal
positions.
## Screenshots
N/A - Test-only change
## Link to pull request in Documentation repository
Documentation: home-assistant/companion.home-assistant#
## Any other notes
This PR merges into #4307 and addresses feedback from the original code
review
(https://github.com/home-assistant/iOS/pull/4307#discussion_r2759282550).
<!-- START COPILOT CODING AGENT TIPS -->
---
✨ Let Copilot coding agent [set things up for
you](https://github.com/home-assistant/iOS/issues/new?title=✨+Set+up+Copilot+instructions&body=Configure%20instructions%20for%20this%20repository%20as%20documented%20in%20%5BBest%20practices%20for%20Copilot%20coding%20agent%20in%20your%20repository%5D%28https://gh.io/copilot-coding-agent-tips%29%2E%0A%0A%3COnboard%20this%20repo%3E&assignees=copilot)
— coding agent works faster and does higher quality work when set up for
your repo.
---------
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: bgoncal <5808343+bgoncal@users.noreply.github.com>