Commit graph

35 commits

Author SHA1 Message Date
Travis Ralston
cec8a77d52 Disable room directory test because it doesn't work
See enclosed comments.
2019-01-30 00:11:01 -07:00
David Baker
0e580635eb Update tests for new platform layout 2018-12-18 18:13:51 +00:00
David Baker
1dfaf70562
Revert "Revert "Run lint on travis builds and use modern node versions"" 2018-11-22 18:25:55 +00:00
David Baker
f701e2601a
Revert "Run lint on travis builds and use modern node versions" 2018-11-22 18:17:09 +00:00
Aaron Raimist
70fe4f67ee
eslint --fix on test/ 2018-10-19 20:59:07 -05:00
Michael Telatynski
f7a26ddb91
fix (race?) broken tests
Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
2017-11-19 20:46:40 +00:00
David Baker
c32e736754 Comment why we don't expect joining flag to reset 2017-09-19 10:23:12 +01:00
David Baker
30efd02d22 Fix test for new behaviour of 'joining' flag
It's no longer reset when the join request completes, so don't
assert it. (The important test is later, asserting that the room
object is non-null).
2017-09-15 15:57:37 +01:00
Richard van der Hoff
66ddf25977 Deflake the joining test
Just give the client longer to get started (it seems to be taking a long time
to get started talking to indexeddb)
2017-07-14 16:14:42 +01:00
Richard van der Hoff
32ef273f9d use flushAllExpected in joining test
It won't do much to help with the vm stopping for 300ms, but it should make the
code and logs clearer.
2017-07-13 13:23:10 +01:00
Richard van der Hoff
d5b550f89a replace q method calls with bluebird ones
```
find src test -name '*.js' |
    xargs perl -i -pe 's/q\.(all|defer|reject|delay|try|isFulfilled)\(/Promise.$1(/'
```
2017-07-13 00:50:01 +01:00
Richard van der Hoff
b29b4a959b q(...) -> Promise.resolve
```
find src test -name '*.js' | xargs perl -i -pe 's/\b[qQ]\(/Promise.resolve(/'
```
2017-07-13 00:50:01 +01:00
Richard van der Hoff
10decf95f6 replace imports of q with bluebird
update `package.json`

```
find src test -name '*.js' |
    xargs perl -i -pe 'if (/require\(.[qQ].\)/) { $_ = "import Promise from '\''bluebird'\'';\n"; }'

find src test -name '*.js' |
    xargs perl -i -pe 'if (/import [qQ] /) { $_ = "import Promise from '\''bluebird'\'';\n"; }'
```
2017-07-13 00:48:31 +01:00
Richard van der Hoff
bd1196716a Use external mock-request
mock-request is now factored out to matrix-mock-request; use it
2017-07-04 15:59:21 +01:00
Richard van der Hoff
a28af8bcc6 Extend timeouts in joining tests again
this seems to work? maybe?
2017-06-15 16:01:26 +01:00
Richard van der Hoff
6f2eee1f03 Attempts to deflakify the joining test
Treat the waitTime passed into `flush` as a timeout rather than a
time-between-loops, so that we can pass in bigger times and not slow the tests
down too much.

Bump the timeout when waiting for /publicRooms and /initialSync in the joining
test.
2017-06-14 22:58:12 +01:00
Luke Barnard
de334cccfd Expect to see HTTP /join/#some:alias when we the view knows it 2017-06-08 18:01:55 +01:00
David Baker
8e288e14bf Add more hacky q.delays
To work around the fact that we now do more trips around the
event loop to update view state (because of going vis the store).
Also add comment saying how horrible this is.
2017-06-06 15:59:24 +01:00
Luke Barnard
feaff9d99d Fix tests for new-guest-access
This time the test wasn't being flaky, but it does inspect a lot of the internal of RoomView, which has had some modifications recently. I've updated the test to reflect this and it passes locally.

Also, fix a bug in HomePage with an undeclared "error" which should be "err".

Let's see what Travis thinks of this!
2017-06-05 20:16:44 +01:00
Richard van der Hoff
f16086bbea Attempt to deflakify joining test
give the client a bit longer to get started.
2017-05-18 13:39:33 +01:00
Richard van der Hoff
593e101521 Fix a flaky test
Depending on timing, the first `httpBackend.flush()` could end up just flushing
a '/presence' call rather than the initial sync. The fix to that is simply to
not set the expectation on /presence.

While we're there, split out the flushes of /publicRooms and
/thirdparty/protocols, so that we can be sure that they happen.

There is probably still a bunch of flakiness there, but this should fix one
particular instance.
2017-04-18 13:45:31 +01:00
Luke Barnard
e40d3852ff Fix tests to reflect recent changes
This is an attempt to reduce flakiness (see https://github.com/matrix-org/matrix-react-sdk/pull/781 also)
2017-03-29 16:07:11 +01:00
Kegan Dougal
d876e4482b 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.
2017-02-17 14:32:08 +00:00
David Baker
161978ab05 Fix tests 2016-12-16 15:20:52 +00:00
David Baker
3938abc5dd add webkit vendor prefixed properties
for mavericks safari
2016-09-23 17:18:52 +01:00
David Baker
d0618c4f49 Update test now that /publicRooms is a post 2016-09-16 20:49:28 +01:00
Richard van der Hoff
dd6868c255 Fix joining test
This had been broken by
https://github.com/matrix-org/matrix-react-sdk/pull/399. Change the way we
populate the matrixclient used for the joining tests.
2016-08-10 22:39:53 +01:00
David Baker
c9ab977d73 Fix unit tests
ReplaceUsingAccessToken was, uh, replaced with replacedUsingCreds
2016-08-05 14:38:10 +01:00
David Baker
607923b58f Fix test since we peek by room ID, not alias 2016-06-17 17:49:36 +01:00
Richard van der Hoff
bf31d6d5fa Karma test tweaks
* Make sure we only get one js-sdk (and update runtime config to match)
* Don't verifyNoOutstandingRequests (since it is hard to be certain which we
  will get, and makes the tests too dependent on implementation-specifics).
* Disable color for npm test, to avoid confusing Jenkins
2016-04-13 17:41:23 +01:00
Richard van der Hoff
181a6a61ff tests: Don't add the div to the DOM 2016-04-13 17:20:06 +01:00
Richard van der Hoff
322af6513d Run some tests under karma
Including a regression test for
https://github.com/vector-im/vector-web/issues/1314
2016-04-13 17:20:06 +01:00
Richard van der Hoff
69ce3c43cf Revert "Merge branch 'develop' into rav/karma"
The karma tests don't pass yet, and aren't ready to land on develop.

This reverts commit 438453e61a, reversing
changes made to 50f94eb040.
2016-04-13 17:17:45 +01:00
Richard van der Hoff
a512e600a7 tests: Don't add the div to the DOM 2016-04-13 11:16:38 +01:00
Richard van der Hoff
429d110212 Run some tests under karma
Including a regression test for
https://github.com/vector-im/vector-web/issues/1314
2016-04-13 10:15:04 +01:00