Skip to content

Fix broken tests caused by adding IndexedDB support#3242

Merged
kegsay merged 1 commit intodevelopfrom
kegan/fix-tests-for-indexeddb
Feb 17, 2017
Merged

Fix broken tests caused by adding IndexedDB support#3242
kegsay merged 1 commit intodevelopfrom
kegan/fix-tests-for-indexeddb

Conversation

@kegsay
Copy link
Copy Markdown
Contributor

@kegsay kegsay commented Feb 17, 2017

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.

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.
Copy link
Copy Markdown
Member

@richvdh richvdh left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

yup, fully agreed. If this fixes the tests, I'm happy

@kegsay kegsay merged commit 5c20499 into develop Feb 17, 2017
@t3chguy t3chguy deleted the kegan/fix-tests-for-indexeddb branch May 12, 2022 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants