diff options
Diffstat (limited to 'server/tests/api/users')
-rw-r--r-- | server/tests/api/users/user-notifications.ts | 36 | ||||
-rw-r--r-- | server/tests/api/users/users.ts | 16 |
2 files changed, 52 insertions, 0 deletions
diff --git a/server/tests/api/users/user-notifications.ts b/server/tests/api/users/user-notifications.ts index 5260d64cc..69e51677e 100644 --- a/server/tests/api/users/user-notifications.ts +++ b/server/tests/api/users/user-notifications.ts | |||
@@ -165,6 +165,8 @@ describe('Test users notifications', function () { | |||
165 | }) | 165 | }) |
166 | 166 | ||
167 | it('Should not send notifications if the user does not follow the video publisher', async function () { | 167 | it('Should not send notifications if the user does not follow the video publisher', async function () { |
168 | this.timeout(10000) | ||
169 | |||
168 | await uploadVideoByLocalAccount(servers) | 170 | await uploadVideoByLocalAccount(servers) |
169 | 171 | ||
170 | const notification = await getLastNotification(servers[ 0 ].url, userAccessToken) | 172 | const notification = await getLastNotification(servers[ 0 ].url, userAccessToken) |
@@ -644,6 +646,8 @@ describe('Test users notifications', function () { | |||
644 | }) | 646 | }) |
645 | 647 | ||
646 | it('Should not send a notification if transcoding is not enabled', async function () { | 648 | it('Should not send a notification if transcoding is not enabled', async function () { |
649 | this.timeout(10000) | ||
650 | |||
647 | const { name, uuid } = await uploadVideoByLocalAccount(servers) | 651 | const { name, uuid } = await uploadVideoByLocalAccount(servers) |
648 | await waitJobs(servers) | 652 | await waitJobs(servers) |
649 | 653 | ||
@@ -717,6 +721,24 @@ describe('Test users notifications', function () { | |||
717 | await wait(6000) | 721 | await wait(6000) |
718 | await checkVideoIsPublished(baseParams, name, uuid, 'presence') | 722 | await checkVideoIsPublished(baseParams, name, uuid, 'presence') |
719 | }) | 723 | }) |
724 | |||
725 | it('Should not send a notification before the video is published', async function () { | ||
726 | this.timeout(20000) | ||
727 | |||
728 | let updateAt = new Date(new Date().getTime() + 100000) | ||
729 | |||
730 | const data = { | ||
731 | privacy: VideoPrivacy.PRIVATE, | ||
732 | scheduleUpdate: { | ||
733 | updateAt: updateAt.toISOString(), | ||
734 | privacy: VideoPrivacy.PUBLIC | ||
735 | } | ||
736 | } | ||
737 | const { name, uuid } = await uploadVideoByRemoteAccount(servers, data) | ||
738 | |||
739 | await wait(6000) | ||
740 | await checkVideoIsPublished(baseParams, name, uuid, 'absence') | ||
741 | }) | ||
720 | }) | 742 | }) |
721 | 743 | ||
722 | describe('My video is imported', function () { | 744 | describe('My video is imported', function () { |
@@ -781,6 +803,8 @@ describe('Test users notifications', function () { | |||
781 | }) | 803 | }) |
782 | 804 | ||
783 | it('Should send a notification only to moderators when a user registers on the instance', async function () { | 805 | it('Should send a notification only to moderators when a user registers on the instance', async function () { |
806 | this.timeout(10000) | ||
807 | |||
784 | await registerUser(servers[0].url, 'user_45', 'password') | 808 | await registerUser(servers[0].url, 'user_45', 'password') |
785 | 809 | ||
786 | await waitJobs(servers) | 810 | await waitJobs(servers) |
@@ -849,6 +873,8 @@ describe('Test users notifications', function () { | |||
849 | }) | 873 | }) |
850 | 874 | ||
851 | it('Should notify when a local account is following one of our channel', async function () { | 875 | it('Should notify when a local account is following one of our channel', async function () { |
876 | this.timeout(10000) | ||
877 | |||
852 | await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:9001') | 878 | await addUserSubscription(servers[0].url, servers[0].accessToken, 'user_1@localhost:9001') |
853 | 879 | ||
854 | await waitJobs(servers) | 880 | await waitJobs(servers) |
@@ -857,6 +883,8 @@ describe('Test users notifications', function () { | |||
857 | }) | 883 | }) |
858 | 884 | ||
859 | it('Should notify when a remote account is following one of our channel', async function () { | 885 | it('Should notify when a remote account is following one of our channel', async function () { |
886 | this.timeout(10000) | ||
887 | |||
860 | await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:9001') | 888 | await addUserSubscription(servers[1].url, servers[1].accessToken, 'user_1@localhost:9001') |
861 | 889 | ||
862 | await waitJobs(servers) | 890 | await waitJobs(servers) |
@@ -926,6 +954,8 @@ describe('Test users notifications', function () { | |||
926 | }) | 954 | }) |
927 | 955 | ||
928 | it('Should not have notifications', async function () { | 956 | it('Should not have notifications', async function () { |
957 | this.timeout(10000) | ||
958 | |||
929 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { | 959 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { |
930 | newVideoFromSubscription: UserNotificationSettingValue.NONE | 960 | newVideoFromSubscription: UserNotificationSettingValue.NONE |
931 | })) | 961 | })) |
@@ -943,6 +973,8 @@ describe('Test users notifications', function () { | |||
943 | }) | 973 | }) |
944 | 974 | ||
945 | it('Should only have web notifications', async function () { | 975 | it('Should only have web notifications', async function () { |
976 | this.timeout(10000) | ||
977 | |||
946 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { | 978 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { |
947 | newVideoFromSubscription: UserNotificationSettingValue.WEB | 979 | newVideoFromSubscription: UserNotificationSettingValue.WEB |
948 | })) | 980 | })) |
@@ -967,6 +999,8 @@ describe('Test users notifications', function () { | |||
967 | }) | 999 | }) |
968 | 1000 | ||
969 | it('Should only have mail notifications', async function () { | 1001 | it('Should only have mail notifications', async function () { |
1002 | this.timeout(10000) | ||
1003 | |||
970 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { | 1004 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { |
971 | newVideoFromSubscription: UserNotificationSettingValue.EMAIL | 1005 | newVideoFromSubscription: UserNotificationSettingValue.EMAIL |
972 | })) | 1006 | })) |
@@ -991,6 +1025,8 @@ describe('Test users notifications', function () { | |||
991 | }) | 1025 | }) |
992 | 1026 | ||
993 | it('Should have email and web notifications', async function () { | 1027 | it('Should have email and web notifications', async function () { |
1028 | this.timeout(10000) | ||
1029 | |||
994 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { | 1030 | await updateMyNotificationSettings(servers[0].url, userAccessToken, immutableAssign(allNotificationSettings, { |
995 | newVideoFromSubscription: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL | 1031 | newVideoFromSubscription: UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL |
996 | })) | 1032 | })) |
diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index ad98ab1c7..c4465d541 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts | |||
@@ -501,6 +501,22 @@ describe('Test users', function () { | |||
501 | accessTokenUser = await userLogin(server, user) | 501 | accessTokenUser = await userLogin(server, user) |
502 | }) | 502 | }) |
503 | 503 | ||
504 | it('Should be able to update another user password', async function () { | ||
505 | await updateUser({ | ||
506 | url: server.url, | ||
507 | userId, | ||
508 | accessToken, | ||
509 | password: 'password updated' | ||
510 | }) | ||
511 | |||
512 | await getMyUserVideoQuotaUsed(server.url, accessTokenUser, 401) | ||
513 | |||
514 | await userLogin(server, user, 400) | ||
515 | |||
516 | user.password = 'password updated' | ||
517 | accessTokenUser = await userLogin(server, user) | ||
518 | }) | ||
519 | |||
504 | it('Should be able to list video blacklist by a moderator', async function () { | 520 | it('Should be able to list video blacklist by a moderator', async function () { |
505 | await getBlacklistedVideosList(server.url, accessTokenUser) | 521 | await getBlacklistedVideosList(server.url, accessTokenUser) |
506 | }) | 522 | }) |