Skip to content

Commit d6427f6

Browse files
committed
Fix waiting condition
1 parent 9b05e60 commit d6427f6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

Assets/Plugins/StreamChat/Tests/StatefulClient/ClientStateSyncTests.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
#if STREAM_TESTS_ENABLED
22
using NUnit.Framework;
3-
using StreamChat.Core.StatefulModels;
43
using System;
54
using System.Collections;
65
using System.Collections.Generic;
@@ -55,9 +54,11 @@ private async Task When_client_reconnects_expect_receiving_missed_messages_Async
5554
// Reconnect other client
5655
await GetConnectedOtherClientAsync();
5756

57+
var expectedMessageIds = new string[] { message.Id, message2.Id };
58+
5859
// Wait for sync request to complete
59-
await WaitWhileTrueAsync(()
60-
=> otherClientChannel.Messages.All(m => m.Id != message.Id || m.Id != message2.Id));
60+
await WaitWhileFalseAsync(()
61+
=> expectedMessageIds.All(otherClientChannel.Messages.Select(m => m.Id).Contains));
6162

6263
// Messages should now be present on the second client with no duplicates
6364
Assert.IsNotNull(otherClientChannel.Messages.Single(m => m.Id == message.Id));

0 commit comments

Comments
 (0)