Skip to content

Commit 3280e03

Browse files
committed
Fix tests
1 parent b791ed6 commit 3280e03

File tree

3 files changed

+5
-27
lines changed

3 files changed

+5
-27
lines changed

openapi.yaml

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -248,12 +248,6 @@ paths:
248248
schema:
249249
type: string
250250
example: 2003
251-
- in: query
252-
name: osdbHash
253-
description: osdbHash of the media file
254-
schema:
255-
type: string
256-
example: 0f0f4c9f3416e24f
257251
- in: query
258252
name: imdbID
259253
description: imdbID of the media file
@@ -272,12 +266,6 @@ paths:
272266
schema:
273267
type: string
274268
example: 1
275-
- in: query
276-
name: filebytesize
277-
description: filebytesize of the media file
278-
schema:
279-
type: string
280-
example: 2431697820
281269
responses:
282270
'200':
283271
description: Media metadata

src/controllers/media.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,7 @@ export const getVideoV2 = async(ctx: ParameterizedContext): Promise<MediaMetadat
219219
const { osdbHash, filebytesize }: DeprecatedUmsQueryParams = ctx.query;
220220
const { episode, season, year }: UmsQueryParams = ctx.query;
221221

222-
// this error will not be logged, the user just need to update to a new version of UMS
222+
// this error will not be logged, the user just needs to update to a new version of UMS
223223
if (osdbHash && filebytesize) {
224224
throw new DeprecationError();
225225
}

test/e2e/media-video.spec.ts

Lines changed: 4 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,6 @@ let mongod: MongoMemoryServer;
2121
const MOVIE_INTERSTELLAR = {
2222
'imdbID': 'tt0816692',
2323
'title': 'Interstellar',
24-
'osdbHash': '0f0f4c9f3416e24f',
25-
'filebytesize': '2431697820',
2624
'plot': 'The adventures of a group of explorers who make use of a newly discovered wormhole to surpass the limitations on human space travel and conquer the vast distances involved in an interstellar voyage.'
2725
};
2826

@@ -42,8 +40,6 @@ const EPISODE_LOST = {
4240
};
4341

4442
const EPISODE_PRISONBREAK = {
45-
'osdbHash': '35acba68a9dcfc8f',
46-
'filebytesize': '271224190',
4743
'title': 'Prison Break',
4844
'episodeTitle': 'Behind the Eyes',
4945
'season': '5',
@@ -64,8 +60,6 @@ const EPISODE_DOCTORWHO = {
6460

6561
const EPISODE_AVATAR = {
6662
'episodeTitle': 'The Boiling Rock (1) & The Boiling Rock (2)',
67-
'osdbHash': 'de334f38f153fb6f',
68-
'filebytesize': '4695739425',
6963
'season': '3',
7064
'episode': '14-15',
7165
'imdbID': 'tt1176477',
@@ -150,12 +144,12 @@ describe('get by all', () => {
150144
});
151145

152146
test('should return a movie by all possible params, from source APIs then store', async() => {
153-
let response = await axios.get(`${appUrl}/api/media/video/v2?osdbHash=${MOVIE_INTERSTELLAR.osdbHash}&filebytesize=${MOVIE_INTERSTELLAR.filebytesize}&title=${MOVIE_INTERSTELLAR.title}&imdbID=${MOVIE_INTERSTELLAR.imdbID}`) as UmsApiMediaAxiosResponse;
147+
let response = await axios.get(`${appUrl}/api/media/video/v2?title=${MOVIE_INTERSTELLAR.title}&imdbID=${MOVIE_INTERSTELLAR.imdbID}`) as UmsApiMediaAxiosResponse;
154148
expect(response.data.title).toEqual(MOVIE_INTERSTELLAR.title);
155149
expect(response.data.type).toEqual('movie');
156150

157151
// subsequent calls should return MongoDB result rather than calling external apis
158-
response = await axios.get(`${appUrl}/api/media/video/v2?osdbHash=${MOVIE_INTERSTELLAR.osdbHash}&filebytesize=${MOVIE_INTERSTELLAR.filebytesize}&title=${MOVIE_INTERSTELLAR.title}&imdbID=${MOVIE_INTERSTELLAR.imdbID}`);
152+
response = await axios.get(`${appUrl}/api/media/video/v2?title=${MOVIE_INTERSTELLAR.title}&imdbID=${MOVIE_INTERSTELLAR.imdbID}`);
159153
expect(response.data.title).toEqual(MOVIE_INTERSTELLAR.title);
160154
expect(response.data.type).toEqual('movie');
161155
});
@@ -222,9 +216,7 @@ describe('get by all', () => {
222216

223217
test('should return an episode by all possible params, from source APIs then store', async() => {
224218
const url = `${appUrl}/api/media/video/v2?`+
225-
`osdbHash=${EPISODE_PRISONBREAK.osdbHash}`+
226-
`&filebytesize=${EPISODE_PRISONBREAK.filebytesize}`+
227-
`&title=${EPISODE_PRISONBREAK.title}`+
219+
`title=${EPISODE_PRISONBREAK.title}`+
228220
`&season=${EPISODE_PRISONBREAK.season}`+
229221
`&episode=${EPISODE_PRISONBREAK.episode}`+
230222
`&year=${EPISODE_PRISONBREAK.year}`;
@@ -262,9 +254,7 @@ describe('get by all', () => {
262254

263255
test('should return two episodes when passed all possible params, from source APIs then store', async() => {
264256
const url = `${appUrl}/api/media/video/v2?`+
265-
`osdbHash=${EPISODE_AVATAR.osdbHash}`+
266-
`&filebytesize=${EPISODE_AVATAR.filebytesize}`+
267-
`&title=${EPISODE_AVATAR.title}`+
257+
`title=${EPISODE_AVATAR.title}`+
268258
`&season=${EPISODE_AVATAR.season}`+
269259
`&episode=${EPISODE_AVATAR.episode}`+
270260
`&year=${EPISODE_AVATAR.year}`;

0 commit comments

Comments
 (0)