diff options
Diffstat (limited to 'server/tests/api/check-params/videos-history.ts')
-rw-r--r-- | server/tests/api/check-params/videos-history.ts | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/server/tests/api/check-params/videos-history.ts b/server/tests/api/check-params/videos-history.ts index 3c1f479e4..7283a4d28 100644 --- a/server/tests/api/check-params/videos-history.ts +++ b/server/tests/api/check-params/videos-history.ts | |||
@@ -1,7 +1,7 @@ | |||
1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ | 1 | /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */ |
2 | 2 | ||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { HttpStatusCode } from '@shared/core-utils' | 4 | import { HttpStatusCode } from '@shared/models' |
5 | import { | 5 | import { |
6 | checkBadCountPagination, | 6 | checkBadCountPagination, |
7 | checkBadStartPagination, | 7 | checkBadStartPagination, |
@@ -37,7 +37,7 @@ describe('Test videos history API validator', function () { | |||
37 | 37 | ||
38 | it('Should fail with an unauthenticated user', async function () { | 38 | it('Should fail with an unauthenticated user', async function () { |
39 | const fields = { currentTime: 5 } | 39 | const fields = { currentTime: 5 } |
40 | await makePutBodyRequest({ url: server.url, path: watchingPath, fields, statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 }) | 40 | await makePutBodyRequest({ url: server.url, path: watchingPath, fields, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) |
41 | }) | 41 | }) |
42 | 42 | ||
43 | it('Should fail with an incorrect video id', async function () { | 43 | it('Should fail with an incorrect video id', async function () { |
@@ -48,7 +48,7 @@ describe('Test videos history API validator', function () { | |||
48 | path, | 48 | path, |
49 | fields, | 49 | fields, |
50 | token: server.accessToken, | 50 | token: server.accessToken, |
51 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 | 51 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
52 | }) | 52 | }) |
53 | }) | 53 | }) |
54 | 54 | ||
@@ -61,7 +61,7 @@ describe('Test videos history API validator', function () { | |||
61 | path, | 61 | path, |
62 | fields, | 62 | fields, |
63 | token: server.accessToken, | 63 | token: server.accessToken, |
64 | statusCodeExpected: HttpStatusCode.NOT_FOUND_404 | 64 | expectedStatus: HttpStatusCode.NOT_FOUND_404 |
65 | }) | 65 | }) |
66 | }) | 66 | }) |
67 | 67 | ||
@@ -72,7 +72,7 @@ describe('Test videos history API validator', function () { | |||
72 | path: watchingPath, | 72 | path: watchingPath, |
73 | fields, | 73 | fields, |
74 | token: server.accessToken, | 74 | token: server.accessToken, |
75 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 | 75 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
76 | }) | 76 | }) |
77 | }) | 77 | }) |
78 | 78 | ||
@@ -84,7 +84,7 @@ describe('Test videos history API validator', function () { | |||
84 | path: watchingPath, | 84 | path: watchingPath, |
85 | fields, | 85 | fields, |
86 | token: server.accessToken, | 86 | token: server.accessToken, |
87 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | 87 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
88 | }) | 88 | }) |
89 | }) | 89 | }) |
90 | }) | 90 | }) |
@@ -99,17 +99,17 @@ describe('Test videos history API validator', function () { | |||
99 | }) | 99 | }) |
100 | 100 | ||
101 | it('Should fail with an unauthenticated user', async function () { | 101 | it('Should fail with an unauthenticated user', async function () { |
102 | await makeGetRequest({ url: server.url, path: myHistoryPath, statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 }) | 102 | await makeGetRequest({ url: server.url, path: myHistoryPath, expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) |
103 | }) | 103 | }) |
104 | 104 | ||
105 | it('Should succeed with the correct params', async function () { | 105 | it('Should succeed with the correct params', async function () { |
106 | await makeGetRequest({ url: server.url, token: server.accessToken, path: myHistoryPath, statusCodeExpected: HttpStatusCode.OK_200 }) | 106 | await makeGetRequest({ url: server.url, token: server.accessToken, path: myHistoryPath, expectedStatus: HttpStatusCode.OK_200 }) |
107 | }) | 107 | }) |
108 | }) | 108 | }) |
109 | 109 | ||
110 | describe('When removing user videos history', function () { | 110 | describe('When removing user videos history', function () { |
111 | it('Should fail with an unauthenticated user', async function () { | 111 | it('Should fail with an unauthenticated user', async function () { |
112 | await makePostBodyRequest({ url: server.url, path: myHistoryPath + '/remove', statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 }) | 112 | await makePostBodyRequest({ url: server.url, path: myHistoryPath + '/remove', expectedStatus: HttpStatusCode.UNAUTHORIZED_401 }) |
113 | }) | 113 | }) |
114 | 114 | ||
115 | it('Should fail with a bad beforeDate parameter', async function () { | 115 | it('Should fail with a bad beforeDate parameter', async function () { |
@@ -119,7 +119,7 @@ describe('Test videos history API validator', function () { | |||
119 | token: server.accessToken, | 119 | token: server.accessToken, |
120 | path: myHistoryRemove, | 120 | path: myHistoryRemove, |
121 | fields: body, | 121 | fields: body, |
122 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 | 122 | expectedStatus: HttpStatusCode.BAD_REQUEST_400 |
123 | }) | 123 | }) |
124 | }) | 124 | }) |
125 | 125 | ||
@@ -130,7 +130,7 @@ describe('Test videos history API validator', function () { | |||
130 | token: server.accessToken, | 130 | token: server.accessToken, |
131 | path: myHistoryRemove, | 131 | path: myHistoryRemove, |
132 | fields: body, | 132 | fields: body, |
133 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | 133 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
134 | }) | 134 | }) |
135 | }) | 135 | }) |
136 | 136 | ||
@@ -139,7 +139,7 @@ describe('Test videos history API validator', function () { | |||
139 | url: server.url, | 139 | url: server.url, |
140 | token: server.accessToken, | 140 | token: server.accessToken, |
141 | path: myHistoryRemove, | 141 | path: myHistoryRemove, |
142 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 | 142 | expectedStatus: HttpStatusCode.NO_CONTENT_204 |
143 | }) | 143 | }) |
144 | }) | 144 | }) |
145 | }) | 145 | }) |