test: Fix TestBridge_SyncWithOnGoingEvents

Checking for the initial status of the original check as this is not
required to verify the intended behavior. The original check is also
prone to issues related to event processing order.
This commit is contained in:
Leander Beernaert
2023-08-28 13:55:14 +02:00
parent 0b9b886039
commit cb6e51531b

View File

@ -297,12 +297,6 @@ func TestBridge_SyncWithOngoingEvents(t *testing.T) {
require.NoError(t, client.Login(info.Addresses[0], string(info.BridgePass))) require.NoError(t, client.Login(info.Addresses[0], string(info.BridgePass)))
defer func() { _ = client.Logout() }() defer func() { _ = client.Logout() }()
status, err := client.Select(`Folders/folder`, false)
require.NoError(t, err)
// Original folder should have more than 0 messages and less than the total.
require.Greater(t, status.Messages, uint32(0))
require.Less(t, status.Messages, uint32(numMsg))
// Check that the new messages arrive in the right location. // Check that the new messages arrive in the right location.
require.Eventually(t, func() bool { require.Eventually(t, func() bool {
status, err := client.Select(`Folders/folder2`, true) status, err := client.Select(`Folders/folder2`, true)