diff options
author | Mark Haines <mark.haines@matrix.org> | 2014-11-17 12:55:24 +0000 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2014-11-17 12:55:24 +0000 |
commit | 5d273a0c76e12e3125dbf06a8f0caa03de01d4a9 (patch) | |
tree | c968f7c7586778b3e7b3053b9c07b4336ba727e8 /syweb/webclient/test/unit/event-stream-service.spec.js | |
parent | SYWEB-152: Remove room join logic from RoomController and put it in eventHand... (diff) | |
download | synapse-5d273a0c76e12e3125dbf06a8f0caa03de01d4a9.tar.xz |
Remove syweb directory. pull in syweb as a dependency from github
Diffstat (limited to 'syweb/webclient/test/unit/event-stream-service.spec.js')
-rw-r--r-- | syweb/webclient/test/unit/event-stream-service.spec.js | 80 |
1 files changed, 0 insertions, 80 deletions
diff --git a/syweb/webclient/test/unit/event-stream-service.spec.js b/syweb/webclient/test/unit/event-stream-service.spec.js deleted file mode 100644 index 6fd7693a70..0000000000 --- a/syweb/webclient/test/unit/event-stream-service.spec.js +++ /dev/null @@ -1,80 +0,0 @@ -describe('EventStreamService', function() { - var q, scope; - - var testInitialSync, testEventStream; - - var matrixService = { - initialSync: function(limit, feedback) { - var defer = q.defer(); - defer.resolve(testInitialSync); - return defer.promise; - }, - getEventStream: function(from, svrTimeout, cliTimeout) { - var defer = q.defer(); - defer.resolve(testEventStream); - return defer.promise; - } - }; - - var eventHandlerService = { - handleInitialSyncDone: function(response) { - - }, - - handleEvents: function(chunk, isLive) { - - } - }; - - // setup the dependencies - beforeEach(function() { - - // reset test data - testInitialSync = { - data: { - end: "foo", - presence: [], - rooms: [] - } - }; - testEventStream = { - data: { - start: "foostart", - end: "fooend", - chunk: [] - } - }; - - // dependencies - module(function ($provide) { - $provide.value('matrixService', matrixService); - $provide.value('eventHandlerService', eventHandlerService); - }); - - // tested service - module('eventStreamService'); - }); - - beforeEach(inject(function($q, $rootScope) { - q = $q; - scope = $rootScope; - })); - - it('should start with /initialSync then go onto /events', inject( - function(eventStreamService) { - spyOn(eventHandlerService, "handleInitialSyncDone"); - spyOn(eventHandlerService, "handleEvents"); - eventStreamService.resume(); - scope.$apply(); // initialSync request - expect(eventHandlerService.handleInitialSyncDone).toHaveBeenCalledWith(testInitialSync); - expect(eventHandlerService.handleEvents).toHaveBeenCalledWith(testEventStream.data.chunk, true); - })); - - it('should use the end token in /initialSync for the next /events request', inject( - function(eventStreamService) { - spyOn(matrixService, "getEventStream").and.callThrough(); - eventStreamService.resume(); - scope.$apply(); // initialSync request - expect(matrixService.getEventStream).toHaveBeenCalledWith("foo", eventStreamService.SERVER_TIMEOUT, eventStreamService.CLIENT_TIMEOUT); - })); -}); |