Commit d8852c62 authored by JC Brand's avatar JC Brand

Fix race conditions in tests

parent 00466cd5
......@@ -1731,7 +1731,7 @@ describe("Groupchats", function () {
view.model.rejoin();
// Test that members aren't removed when we reconnect
expect(view.model.occupants.length).toBe(8);
expect(occupants.querySelectorAll('li').length).toBe(8);
await u.waitUntil(() => occupants.querySelectorAll('li').length === 8);
done();
}));
......@@ -1784,8 +1784,8 @@ describe("Groupchats", function () {
role: 'none'
});
_converse.connection._dataRecv(mock.createRequest(presence));
expect(occupants.querySelectorAll('li').length).toBe(i+1);
}
await u.waitUntil(() => occupants.querySelectorAll('li').length === 1);
done();
}));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment