aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/check-params/user-notifications.ts
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests/api/check-params/user-notifications.ts')
-rw-r--r--server/tests/api/check-params/user-notifications.ts20
1 files changed, 8 insertions, 12 deletions
diff --git a/server/tests/api/check-params/user-notifications.ts b/server/tests/api/check-params/user-notifications.ts
index 26d4423f9..913eca366 100644
--- a/server/tests/api/check-params/user-notifications.ts
+++ b/server/tests/api/check-params/user-notifications.ts
@@ -2,25 +2,21 @@
2 2
3import 'mocha' 3import 'mocha'
4import { io } from 'socket.io-client' 4import { io } from 'socket.io-client'
5 5import { HttpStatusCode } from '@shared/core-utils'
6import { 6import {
7 checkBadCountPagination,
8 checkBadSortPagination,
9 checkBadStartPagination,
7 cleanupTests, 10 cleanupTests,
8 flushAndRunServer, 11 flushAndRunServer,
9 immutableAssign,
10 makeGetRequest, 12 makeGetRequest,
11 makePostBodyRequest, 13 makePostBodyRequest,
12 makePutBodyRequest, 14 makePutBodyRequest,
13 ServerInfo, 15 ServerInfo,
14 setAccessTokensToServers, 16 setAccessTokensToServers,
15 wait 17 wait
16} from '../../../../shared/extra-utils' 18} from '@shared/extra-utils'
17import { 19import { UserNotificationSetting, UserNotificationSettingValue } from '@shared/models'
18 checkBadCountPagination,
19 checkBadSortPagination,
20 checkBadStartPagination
21} from '../../../../shared/extra-utils/requests/check-api-params'
22import { UserNotificationSetting, UserNotificationSettingValue } from '../../../../shared/models/users'
23import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
24 20
25describe('Test user notifications API validators', function () { 21describe('Test user notifications API validators', function () {
26 let server: ServerInfo 22 let server: ServerInfo
@@ -193,7 +189,7 @@ describe('Test user notifications API validators', function () {
193 189
194 it('Should fail with incorrect field values', async function () { 190 it('Should fail with incorrect field values', async function () {
195 { 191 {
196 const fields = immutableAssign(correctFields, { newCommentOnMyVideo: 15 }) 192 const fields = { ...correctFields, newCommentOnMyVideo: 15 }
197 193
198 await makePutBodyRequest({ 194 await makePutBodyRequest({
199 url: server.url, 195 url: server.url,
@@ -205,7 +201,7 @@ describe('Test user notifications API validators', function () {
205 } 201 }
206 202
207 { 203 {
208 const fields = immutableAssign(correctFields, { newCommentOnMyVideo: 'toto' }) 204 const fields = { ...correctFields, newCommentOnMyVideo: 'toto' }
209 205
210 await makePutBodyRequest({ 206 await makePutBodyRequest({
211 url: server.url, 207 url: server.url,