diff options
author | Kegan Dougal <kegan@matrix.org> | 2014-11-14 16:15:32 +0000 |
---|---|---|
committer | Kegan Dougal <kegan@matrix.org> | 2014-11-14 16:15:32 +0000 |
commit | b93804529db45ab8bc5e320bdb9b34e9580e111a (patch) | |
tree | 976f187344f727b31b307c9bbe4d0ac84c87ce61 /syweb/webclient/test/unit/event-handler-service.spec.js | |
parent | Fix bug which caused notifications to appear for old messages. (diff) | |
download | synapse-b93804529db45ab8bc5e320bdb9b34e9580e111a.tar.xz |
Move getUserPowerLevel to modelService.
Diffstat (limited to 'syweb/webclient/test/unit/event-handler-service.spec.js')
-rw-r--r-- | syweb/webclient/test/unit/event-handler-service.spec.js | 47 |
1 files changed, 0 insertions, 47 deletions
diff --git a/syweb/webclient/test/unit/event-handler-service.spec.js b/syweb/webclient/test/unit/event-handler-service.spec.js index 2a4dc3b5a5..c17cdb8715 100644 --- a/syweb/webclient/test/unit/event-handler-service.spec.js +++ b/syweb/webclient/test/unit/event-handler-service.spec.js @@ -67,51 +67,4 @@ describe('EventHandlerService', function() { var num = eventHandlerService.getUsersCountInRoom(roomId); expect(num).toEqual(2); })); - - it('should be able to get a users power level', inject( - function(eventHandlerService) { - var roomId = "!foo:matrix.org"; - // set mocked data - modelService.getRoom = function(roomId) { - return { - room_id: roomId, - current_room_state: { - members: { - "@adam:matrix.org": { - event: { - content: { membership: "join" }, - user_id: "@adam:matrix.org" - } - }, - "@beth:matrix.org": { - event: { - content: { membership: "join" }, - user_id: "@beth:matrix.org" - } - } - }, - s: { - "m.room.power_levels": { - content: { - "@adam:matrix.org": 90, - "default": 50 - } - } - }, - state: function(type, key) { - return key ? this.s[type+key] : this.s[type] - } - } - }; - }; - - var num = eventHandlerService.getUserPowerLevel(roomId, "@beth:matrix.org"); - expect(num).toEqual(50); - - num = eventHandlerService.getUserPowerLevel(roomId, "@adam:matrix.org"); - expect(num).toEqual(90); - - num = eventHandlerService.getUserPowerLevel(roomId, "@unknown:matrix.org"); - expect(num).toEqual(50); - })); }); |