J. Ryan Stinnett
761806c678
Add support for class properties
...
This enables compiler and linting features to allow class properties like we do
in the React SDK.
2019-05-13 13:52:37 +01:00
Bruno Windels
2ed694b041
remove supersedes OOB logic
2018-10-11 14:32:03 +02:00
David Baker
a0639a32c7
Revert "Revert "Don't rely on members to query if syncing user can post to room""
2018-09-06 11:47:40 +01:00
David Baker
04ad3d7c3c
Revert "Don't rely on members to query if syncing user can post to room"
2018-09-05 18:04:19 +01:00
Bruno Windels
8b00083bca
check power levels without relying on membership
...
as this might not be known for the syncing user.
instead, add a method to room which always knows the syncing user's membership
2018-09-05 12:36:53 +02:00
Bruno Windels
bb490faefe
fix lint
2018-08-15 11:59:40 +02:00
Bruno Windels
d8f673ed51
make sure invited count cache gets reset when updating member
2018-08-15 11:59:40 +02:00
Bruno Windels
6ce7170cf4
counts from summary api should override count members manually as members might not be complete
2018-08-15 11:59:40 +02:00
Bruno Windels
48c3dcc08a
fix lint & fix and add tests
2018-08-15 11:59:39 +02:00
Bruno Windels
df758b31b7
fix lint
2018-08-15 11:59:39 +02:00
Bruno Windels
198d2c780d
test that modifications to clone'd() room state dont affect the old
2018-08-15 11:59:39 +02:00
Bruno Windels
0234f11914
some tests for room member + state, and some fixes to make them pass
2018-08-15 11:59:39 +02:00
Bruno Windels
1c81a17298
Fix tests
...
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.
2018-08-15 11:59:39 +02:00
Bruno Windels
e3e48944e0
add test
2018-07-27 11:49:55 +02:00
Richard van der Hoff
bd226d94d8
Switch from jasmine to mocha + expect + lolex
...
Much of this transformation has been done automatically:
* add expect import to each file
* replace `not.to` with `toNot`
* replace `to[Not]Be{Undefined,Null}` with equivalents
* replace `jasmine.createSpy(...)` with `except.createSpy`, and `andCallFake`
with `andCall`
Also:
* replace `jasmine.createSpyObj` with manual alternatives
* replace `jasmine.Clock` with `lolex`
2017-02-08 14:32:37 +00:00
Richard van der Hoff
80d0aadbd0
Install source-map-support in each test
...
This makes exception traces use the source map, which is much more helpful when
debugging.
2017-02-07 22:57:09 +00:00
David Baker
423175f539
eslint --fix for dangley commas on function calls
2017-01-20 16:12:02 +00:00
David Baker
7bca05af64
eslint ---fix for prefer-const
2017-01-19 17:42:10 +00:00
Kegan Dougal
7ed65407e6
Pass through eslint --fix
2017-01-13 10:49:32 +00:00
David Baker
e057956ede
Add google eslint rules as a base
...
Remove some we don't care about. Set some other ones we do care
about but don't currently adhere to to warn. Set the max warnings
threshold to the current number of warnings, so we don't introduce
more of them. Fix a bunch of legit lint errors and add exceptions
to various places in the test code that does funny things with
'this'.
2017-01-12 14:35:58 +00:00
David Baker
88cc63e2a2
Add maySendEvent to match maySendStateEvent. Make them use the same function internally. Also add convenience maySendMessage. Also tests.
2016-03-23 15:10:51 +00:00
David Baker
f324e4c72f
lint
2016-03-03 17:48:23 +00:00
David Baker
9328a12ccb
Add maySendStateEvent method, ported from react-sdk (but fixed). Plus tests.
2016-03-03 17:44:27 +00:00
Kegan Dougal
8f16948430
Appease linters
2015-06-24 14:57:48 +01:00
Kegan Dougal
1b665c176a
Add RoomState UTs
2015-06-24 14:57:04 +01:00
Kegan Dougal
0bc9951f13
Add RoomState UT stubs.
2015-06-24 13:52:17 +01:00
Kegan Dougal
fc2c6f403d
Re-add power-level/typing UTs as RoomMember tests.
2015-06-10 17:19:56 +01:00
Kegan Dougal
5cf29ae1b1
Make RoomMember set its own properties, not RoomState.
...
Also make it clear which methods may fire events off using @fires. This
shifts a lot of RoomState logic to RoomMember.
2015-06-10 17:06:28 +01:00
Kegan Dougal
13462ad1aa
Add more Room and RoomState unit tests.
2015-06-09 16:07:44 +01:00
Kegan Dougal
a0bd25a6d2
Handle power levels and update RoomMember properties.
...
Add unit tests for RoomState.
2015-06-09 15:23:04 +01:00