Skip to content

Commit 18c0eb4

Browse files
authored
Fix stale test: resume now re-syncs conversations (#519)
PR #514 added syncAllConversations on resume to pick up changes while paused/backgrounded, but the test still asserted it should not be called. Update to match current behavior.
1 parent 3be601d commit 18c0eb4

1 file changed

Lines changed: 6 additions & 2 deletions

File tree

ConvosCore/Tests/ConvosCoreTests/SyncingManagerTests.swift

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -522,7 +522,7 @@ struct SyncingManagerTests {
522522
try? await fixtures.cleanup()
523523
}
524524

525-
@Test("Resume restarts streams without calling syncAllConversations")
525+
@Test("Resume restarts streams and re-syncs conversations")
526526
func testResumeFlow() async throws {
527527
let fixtures = TestFixtures()
528528
let mockClient = TestableMockClient()
@@ -555,7 +555,11 @@ struct SyncingManagerTests {
555555
conversations.streamCallCount >= 4
556556
}
557557

558-
#expect(conversations.syncCallCount == initialSyncCount, "syncAllConversations should not be called on resume")
558+
try await waitUntil(timeout: .seconds(5)) {
559+
conversations.syncCallCount > initialSyncCount
560+
}
561+
562+
#expect(conversations.syncCallCount > initialSyncCount, "syncAllConversations should be called on resume to pick up changes while paused")
559563

560564
await syncingManager.stop()
561565
try? await fixtures.cleanup()

0 commit comments

Comments
 (0)