Skip to content

Commit d876e44

Browse files
committed
Fix broken tests caused by adding IndexedDB support
This test assumed that `/sync` would be called immediately after rendering `<MatrixChat />` but this isn't true in an IndexedDB world: it bounces via `store.startup()` first. It looks like the tests resolve this by adding `q.delay(1)` so that's what I've done: in the future it would be better to extend `HttpBackend` to have a `waitFor(req) Promise` function so we can removing timing from the tests.
1 parent 7509747 commit d876e44

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎test/app-tests/joining.js‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,10 @@ describe('joining a room', function () {
9595
});
9696

9797
var roomView;
98-
httpBackend.flush().then(() => {
98+
// wait for /sync to happen
99+
return q.delay(1).then(() => {
100+
return httpBackend.flush();
101+
}).then(() => {
99102
var roomDir = ReactTestUtils.findRenderedComponentWithType(
100103
matrixChat, RoomDirectory);
101104

0 commit comments

Comments
 (0)