summary refs log tree commit diff
path: root/syweb/webclient/test/unit/model-service.spec.js
diff options
context:
space:
mode:
authorErik Johnston <erik@matrix.org>2014-11-07 10:55:28 +0000
committerErik Johnston <erik@matrix.org>2014-11-07 10:55:28 +0000
commit3cb678f84cb3252f08788a31bef1a205edffde9c (patch)
tree01ad785dc284526ecd4aa1a04ce132bcf639f5ac /syweb/webclient/test/unit/model-service.spec.js
parentFix joining over federation (diff)
parentDon't cache isWebRTCSupported because whether webRTC is supported might chang... (diff)
downloadsynapse-3cb678f84cb3252f08788a31bef1a205edffde9c.tar.xz
Merge branch 'develop' of github.com:matrix-org/synapse into federation_authorization
Diffstat (limited to 'syweb/webclient/test/unit/model-service.spec.js')
-rw-r--r--syweb/webclient/test/unit/model-service.spec.js30
1 files changed, 30 insertions, 0 deletions
diff --git a/syweb/webclient/test/unit/model-service.spec.js b/syweb/webclient/test/unit/model-service.spec.js
new file mode 100644

index 0000000000..e2fa8ceba3 --- /dev/null +++ b/syweb/webclient/test/unit/model-service.spec.js
@@ -0,0 +1,30 @@ +describe('ModelService', function() { + + // setup the dependencies + beforeEach(function() { + // dependencies + module('matrixService'); + + // tested service + module('modelService'); + }); + + it('should be able to get a member in a room', inject( + function(modelService) { + var roomId = "!wefiohwefuiow:matrix.org"; + var userId = "@bob:matrix.org"; + + modelService.getRoom(roomId).current_room_state.storeStateEvent({ + type: "m.room.member", + id: "fwefw:matrix.org", + user_id: userId, + state_key: userId, + content: { + membership: "join" + } + }); + + var user = modelService.getMember(roomId, userId); + expect(user.event.state_key).toEqual(userId); + })); +});