From 764698c6e031c39073aed5eabafe4660aa33ec10 Mon Sep 17 00:00:00 2001 From: Theo Browne Date: Fri, 31 Jul 2026 14:05:06 -0700 Subject: [PATCH] test(ios): cover large native home collections --- .../FeatureTests/DailyUXSidebarTests.swift | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/apps/swift-ios/Tests/FeatureTests/DailyUXSidebarTests.swift b/apps/swift-ios/Tests/FeatureTests/DailyUXSidebarTests.swift index cc6dae0722..7c53bc1612 100644 --- a/apps/swift-ios/Tests/FeatureTests/DailyUXSidebarTests.swift +++ b/apps/swift-ios/Tests/FeatureTests/DailyUXSidebarTests.swift @@ -336,6 +336,25 @@ struct DailyUXSidebarTests { ) } + @Test + func largeWorkingCollectionKeepsStableOrderWithoutParentTimerRefresh() { + let threads = (0..<5_000).map { offset in + thread( + id: "thread-\(offset)", + created: -Double(offset), + updated: -Double(offset), + state: .working + ) + } + + let index = makeIndex(threads) + + #expect(index.active.count == threads.count) + #expect(index.active.prefix(3).map(\.id) == ["thread-0", "thread-1", "thread-2"]) + #expect(index.active.last?.id == "thread-4999") + #expect(DailyUXSidebarRefresh.nextBoundary(for: threads, after: now) == nil) + } + @Test func compactRelativeAgeClampsFutureDatesAndUsesStableUnits() { #expect(