diff options
Diffstat (limited to 'client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts')
-rw-r--r-- | client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts b/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts index f9055b82c..698b2e27b 100644 --- a/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts +++ b/client/src/app/videos/recommendations/recent-videos-recommendation.service.spec.ts | |||
@@ -21,7 +21,7 @@ describe('"Recent Videos" Recommender', () => { | |||
21 | { uuid: 'uuid2' } | 21 | { uuid: 'uuid2' } |
22 | ] | 22 | ] |
23 | getVideosMock.mockReturnValueOnce(of({ videos: vids })) | 23 | getVideosMock.mockReturnValueOnce(of({ videos: vids })) |
24 | const result = await service.getRecommendations('uuid1').toPromise() | 24 | const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise() |
25 | const uuids = result.map(v => v.uuid) | 25 | const uuids = result.map(v => v.uuid) |
26 | expect(uuids).toEqual(['uuid2']) | 26 | expect(uuids).toEqual(['uuid2']) |
27 | done() | 27 | done() |
@@ -36,7 +36,7 @@ describe('"Recent Videos" Recommender', () => { | |||
36 | { uuid: 'uuid7' } | 36 | { uuid: 'uuid7' } |
37 | ] | 37 | ] |
38 | getVideosMock.mockReturnValueOnce(of({ videos: vids })) | 38 | getVideosMock.mockReturnValueOnce(of({ videos: vids })) |
39 | const result = await service.getRecommendations('uuid1').toPromise() | 39 | const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise() |
40 | expect(result.length).toEqual(5) | 40 | expect(result.length).toEqual(5) |
41 | done() | 41 | done() |
42 | }) | 42 | }) |
@@ -51,12 +51,12 @@ describe('"Recent Videos" Recommender', () => { | |||
51 | ] | 51 | ] |
52 | getVideosMock | 52 | getVideosMock |
53 | .mockReturnValueOnce(of({ videos: vids })) | 53 | .mockReturnValueOnce(of({ videos: vids })) |
54 | const result = await service.getRecommendations('uuid1').toPromise() | 54 | const result = await service.getRecommendations({ uuid: 'uuid1' }).toPromise() |
55 | expect(result.length).toEqual(5) | 55 | expect(result.length).toEqual(5) |
56 | done() | 56 | done() |
57 | }) | 57 | }) |
58 | it('should fetch an extra result in case the given UUID is in the list', async (done) => { | 58 | it('should fetch an extra result in case the given UUID is in the list', async (done) => { |
59 | await service.getRecommendations('uuid1').toPromise() | 59 | await service.getRecommendations({ uuid: 'uuid1' }).toPromise() |
60 | let expectedSize = service.pageSize + 1 | 60 | let expectedSize = service.pageSize + 1 |
61 | let params = { currentPage: jasmine.anything(), itemsPerPage: expectedSize } | 61 | let params = { currentPage: jasmine.anything(), itemsPerPage: expectedSize } |
62 | expect(getVideosMock).toHaveBeenCalledWith(params, jasmine.anything()) | 62 | expect(getVideosMock).toHaveBeenCalledWith(params, jasmine.anything()) |