diff options
Diffstat (limited to 'server/tests/api/check-params/user-notifications.ts')
-rw-r--r-- | server/tests/api/check-params/user-notifications.ts | 31 |
1 files changed, 16 insertions, 15 deletions
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts index 6fa0502be..05a78b0ad 100644 --- a/server/tests/api/check-params/user-notifications.ts +++ b/server/tests/api/check-params/user-notifications.ts | |||
@@ -20,6 +20,7 @@ import { | |||
20 | checkBadStartPagination | 20 | checkBadStartPagination |
21 | } from '../../../../shared/extra-utils/requests/check-api-params' | 21 | } from '../../../../shared/extra-utils/requests/check-api-params' |
22 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../../shared/models/users' | 22 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../../../shared/models/users' |
23 | import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes' | ||
23 | 24 | ||
24 | describe('Test user notifications API validators', function () { | 25 | describe('Test user notifications API validators', function () { |
25 | let server: ServerInfo | 26 | let server: ServerInfo |
@@ -57,7 +58,7 @@ describe('Test user notifications API validators', function () { | |||
57 | unread: 'toto' | 58 | unread: 'toto' |
58 | }, | 59 | }, |
59 | token: server.accessToken, | 60 | token: server.accessToken, |
60 | statusCodeExpected: 200 | 61 | statusCodeExpected: HttpStatusCode.OK_200 |
61 | }) | 62 | }) |
62 | }) | 63 | }) |
63 | 64 | ||
@@ -65,7 +66,7 @@ describe('Test user notifications API validators', function () { | |||
65 | await makeGetRequest({ | 66 | await makeGetRequest({ |
66 | url: server.url, | 67 | url: server.url, |
67 | path, | 68 | path, |
68 | statusCodeExpected: 401 | 69 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
69 | }) | 70 | }) |
70 | }) | 71 | }) |
71 | 72 | ||
@@ -74,7 +75,7 @@ describe('Test user notifications API validators', function () { | |||
74 | url: server.url, | 75 | url: server.url, |
75 | path, | 76 | path, |
76 | token: server.accessToken, | 77 | token: server.accessToken, |
77 | statusCodeExpected: 200 | 78 | statusCodeExpected: HttpStatusCode.OK_200 |
78 | }) | 79 | }) |
79 | }) | 80 | }) |
80 | }) | 81 | }) |
@@ -90,7 +91,7 @@ describe('Test user notifications API validators', function () { | |||
90 | ids: [ 'hello' ] | 91 | ids: [ 'hello' ] |
91 | }, | 92 | }, |
92 | token: server.accessToken, | 93 | token: server.accessToken, |
93 | statusCodeExpected: 400 | 94 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
94 | }) | 95 | }) |
95 | 96 | ||
96 | await makePostBodyRequest({ | 97 | await makePostBodyRequest({ |
@@ -100,7 +101,7 @@ describe('Test user notifications API validators', function () { | |||
100 | ids: [ ] | 101 | ids: [ ] |
101 | }, | 102 | }, |
102 | token: server.accessToken, | 103 | token: server.accessToken, |
103 | statusCodeExpected: 400 | 104 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
104 | }) | 105 | }) |
105 | 106 | ||
106 | await makePostBodyRequest({ | 107 | await makePostBodyRequest({ |
@@ -110,7 +111,7 @@ describe('Test user notifications API validators', function () { | |||
110 | ids: 5 | 111 | ids: 5 |
111 | }, | 112 | }, |
112 | token: server.accessToken, | 113 | token: server.accessToken, |
113 | statusCodeExpected: 400 | 114 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
114 | }) | 115 | }) |
115 | }) | 116 | }) |
116 | 117 | ||
@@ -121,7 +122,7 @@ describe('Test user notifications API validators', function () { | |||
121 | fields: { | 122 | fields: { |
122 | ids: [ 5 ] | 123 | ids: [ 5 ] |
123 | }, | 124 | }, |
124 | statusCodeExpected: 401 | 125 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
125 | }) | 126 | }) |
126 | }) | 127 | }) |
127 | 128 | ||
@@ -133,7 +134,7 @@ describe('Test user notifications API validators', function () { | |||
133 | ids: [ 5 ] | 134 | ids: [ 5 ] |
134 | }, | 135 | }, |
135 | token: server.accessToken, | 136 | token: server.accessToken, |
136 | statusCodeExpected: 204 | 137 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 |
137 | }) | 138 | }) |
138 | }) | 139 | }) |
139 | }) | 140 | }) |
@@ -145,7 +146,7 @@ describe('Test user notifications API validators', function () { | |||
145 | await makePostBodyRequest({ | 146 | await makePostBodyRequest({ |
146 | url: server.url, | 147 | url: server.url, |
147 | path, | 148 | path, |
148 | statusCodeExpected: 401 | 149 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
149 | }) | 150 | }) |
150 | }) | 151 | }) |
151 | 152 | ||
@@ -154,7 +155,7 @@ describe('Test user notifications API validators', function () { | |||
154 | url: server.url, | 155 | url: server.url, |
155 | path, | 156 | path, |
156 | token: server.accessToken, | 157 | token: server.accessToken, |
157 | statusCodeExpected: 204 | 158 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 |
158 | }) | 159 | }) |
159 | }) | 160 | }) |
160 | }) | 161 | }) |
@@ -184,7 +185,7 @@ describe('Test user notifications API validators', function () { | |||
184 | path, | 185 | path, |
185 | token: server.accessToken, | 186 | token: server.accessToken, |
186 | fields: { newVideoFromSubscription: UserNotificationSettingValue.WEB }, | 187 | fields: { newVideoFromSubscription: UserNotificationSettingValue.WEB }, |
187 | statusCodeExpected: 400 | 188 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
188 | }) | 189 | }) |
189 | }) | 190 | }) |
190 | 191 | ||
@@ -197,7 +198,7 @@ describe('Test user notifications API validators', function () { | |||
197 | path, | 198 | path, |
198 | token: server.accessToken, | 199 | token: server.accessToken, |
199 | fields, | 200 | fields, |
200 | statusCodeExpected: 400 | 201 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
201 | }) | 202 | }) |
202 | } | 203 | } |
203 | 204 | ||
@@ -209,7 +210,7 @@ describe('Test user notifications API validators', function () { | |||
209 | path, | 210 | path, |
210 | fields, | 211 | fields, |
211 | token: server.accessToken, | 212 | token: server.accessToken, |
212 | statusCodeExpected: 400 | 213 | statusCodeExpected: HttpStatusCode.BAD_REQUEST_400 |
213 | }) | 214 | }) |
214 | } | 215 | } |
215 | }) | 216 | }) |
@@ -219,7 +220,7 @@ describe('Test user notifications API validators', function () { | |||
219 | url: server.url, | 220 | url: server.url, |
220 | path, | 221 | path, |
221 | fields: correctFields, | 222 | fields: correctFields, |
222 | statusCodeExpected: 401 | 223 | statusCodeExpected: HttpStatusCode.UNAUTHORIZED_401 |
223 | }) | 224 | }) |
224 | }) | 225 | }) |
225 | 226 | ||
@@ -229,7 +230,7 @@ describe('Test user notifications API validators', function () { | |||
229 | path, | 230 | path, |
230 | token: server.accessToken, | 231 | token: server.accessToken, |
231 | fields: correctFields, | 232 | fields: correctFields, |
232 | statusCodeExpected: 204 | 233 | statusCodeExpected: HttpStatusCode.NO_CONTENT_204 |
233 | }) | 234 | }) |
234 | }) | 235 | }) |
235 | }) | 236 | }) |