|
|
|
@ -395,4 +395,79 @@ describe('createOmdbEnrichedDataService', () => { |
|
|
|
|
|
|
|
|
|
expect(result).toBeUndefined(); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for writer = George Lucas', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ writers: 'George Lucas' }); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([ |
|
|
|
|
{ title: 'Indiana Jones and the Last Crusade' }, |
|
|
|
|
{ title: 'Star Wars: Episode IV - A New Hope' }, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for writer = George Lucas and actor = Harrison Ford', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ |
|
|
|
|
actors: 'Harrison Ford', |
|
|
|
|
writers: 'George Lucas', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([ |
|
|
|
|
{ title: 'Indiana Jones and the Last Crusade' }, |
|
|
|
|
{ title: 'Star Wars: Episode IV - A New Hope' }, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for writer = George Lucas and actor = Mark Hamill', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ |
|
|
|
|
actors: 'Mark Hamill', |
|
|
|
|
writers: 'George Lucas', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([ |
|
|
|
|
{ title: 'Star Wars: Episode IV - A New Hope' }, |
|
|
|
|
]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for title = The Jungle Book', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ title: 'The Jungle Book' }); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([{ title: 'The Jungle Book' }]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for local title = Das Dschungelbuch', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ |
|
|
|
|
localTitle: 'Das Dschungelbuch', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([{ title: 'The Jungle Book' }]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns correct search results for production year = 1967', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ productionYear: 1967 }); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([{ title: 'The Jungle Book' }]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns empty search results for writer = George Lucas and actor = Bruce Willis', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ |
|
|
|
|
actors: 'Bruce Willis', |
|
|
|
|
writers: 'George Lucas', |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([]); |
|
|
|
|
}); |
|
|
|
|
|
|
|
|
|
it('returns empty search results for title = Blood Quantum', async () => { |
|
|
|
|
const service = await servicePromise; |
|
|
|
|
const result = service.getSearchResults({ title: 'Blood Quantum' }); |
|
|
|
|
|
|
|
|
|
expect(result).toMatchObject([]); |
|
|
|
|
}); |
|
|
|
|
}); |
|
|
|
|