Otherwise, the RoomWidgetClient class can end up accidentally sending and receiving events from rooms it didn't intend to, if it's an always-on-screen widget.
* Fix race in creating calls
We ran an async function between checking for an existing call and
adding the new one to the map, so it would have been possible to
start creating another call while we were placing the first call.
This changes the code to add the call to the map as soon as we've
created it.
Also adds more logging.
* Switch to logger.debug
* Fix unit tests
* MediaHandler Tests, part 1
Haven't got through all the methods yet
For https://github.com/vector-im/element-call/issues/544
* Didn't need these in the end
* Rest of the media handler tests
* getUserMediaStream takes args
* use mockResolvedValue
* Add .off & reuse the mock we already made
* Re-use mock handler again
* Move updateLocalUsermediaStream to beforeEach
* add .off
* Add types
* Add more .offs
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* Base support for MSC3847: Ignore invites with policy rooms
Type: enhancement
* WIP: Applying feedback
* WIP: Applying feedback
* WIP: CI linter gives me different errors, weird
* WIP: A little more linting
* utils: Fix bug in deepCompare which would incorrectly return objects with disjoint keys as equal
* Fix bugs in sync test
This test wrongly asserted that `initialSyncLimit` would be used to make a filter
It is used only for the initial sync inline filter, and not in POST /filter
Co-authored-by: Michael Telatynski <7t3chguy@gmail.com>
* Add types to the call unit test suites
Still involves quite a few casts to any unfortunately as it turns
out we access quite a few private methods on the Call class in these
tests.
* Remove commented line & use better expect syntax
* Replace more calls.length with toHaveBeenCalled
* Remove mistakenly added id field
* 1:1 screenshare tests
Fixes https://github.com/vector-im/element-call/issues/548
* Always hang up calls after tests
to prevent hanging tests
Also fix a null dereference as we may not have an invitee or opponent
member when sending voip events if not using to-device messages.
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* use mockImplementationOnce
Co-authored-by: Robin <robin@robin.town>
* Add type on mock
* Add corresponding call.off
* Merge enable & disable screenshare tests
Co-authored-by: Robin <robin@robin.town>
* Add tests for incoming calls in group calls
Inspiration wwlecome for the renamed describe group which we're
really abusing for a bunch of things that happen to have the same
dependencies.
Fixes https://github.com/vector-im/element-call/issues/532
* Extract incoming call tests out into their own describe
and get the lexicographical ordering to match who should be calling who
* Trailing space
* Test placing a call in a group call
Refactors a bit of the call testing stuff
Fixes https://github.com/vector-im/element-call/issues/521
* Unused imports
* Use expect.toHaveBeenCalledWith()
* Types
* More types
* Add comment on mock typing
* Use toHaveBeenCalledWith()
* Initialise groupcall & room in beforeEach
* Initialise mockMediahandler sensibly
* Add type params to mock
* Rename mute tests
* Move comment
* Join / leave in parallel
* Remove leftover expect