I tried keeping the mocking but it would take too much
boilerplate code to make the tests work again, and even more
to write the tests for room name with lazy loading.
Just testing everything with a real implementation is not really
a unit test any more, but proved way easier.
It'll be somewhat annoying these tests will fail if there is
something wrong in roomstate (not room), but that's the trade-off
some tests for mock getMember, some for .members
if you use either in the code (as I did for room display name changes)
tests start playing and you play whack-a-mole switching between
both ways of accessing the members in a room.
lets start using one way so mocking becomes easier,
and besides, accessing an object internal members is not the best idea.
getSentinelMember now does return a member (with just the userid) when there is no corresponding member yet.
With lazy loading it's perfectly possible the member is not available, and null breaks continuation in the timeline.
* OlmDevice.hasInboundSessionKeys
* OlmDevice.getInboundGroupSessionKey
The latter means that MegolmDecryption.shareKeysWithDevice takes longer before
it sends out the keyshare, so means the unit test needed an update
... instead of having it call event.setClearData.
The main advantage of this is that it fixes a race condition, wherein apps
could see `event.isDecrypting()` to be true, but in fact the event had been
decrypted (and there was no `Event.decrypted` event on its way).
We're also fixing another race, wherein if the first attempt to decrypt failed,
a call to `attemptDecryption` would race against the first call and a second
attempt to decrypt would never happen.
This also gives a cleaner interface to MatrixEvent, at the expense of making
the `megolm` unit test a bit more hoop-jumpy.
Automated replacement of utils.failTest with nodeify
This was done with the perl incantation:
```
find spec -name '*.js' |
xargs perl -i -pe 's/catch\((testUtils|utils).failTest\).done\(done\)/nodeify(done)/'
```
more auto