diff options
author | Chocobozzz <me@florianbigard.com> | 2021-07-09 14:15:11 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-07-20 15:27:18 +0200 |
commit | 12edc1495a36b2199f1bf1ba37f50c7b694be382 (patch) | |
tree | 3abfe2e5b54076de73fbfa25386d0313fc3b7242 /server/tests/plugins/action-hooks.ts | |
parent | a54618880c394ad7571f3f3222dc96ec2dd10d9a (diff) | |
download | PeerTube-12edc1495a36b2199f1bf1ba37f50c7b694be382.tar.gz PeerTube-12edc1495a36b2199f1bf1ba37f50c7b694be382.tar.zst PeerTube-12edc1495a36b2199f1bf1ba37f50c7b694be382.zip |
Introduce comments command
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r-- | server/tests/plugins/action-hooks.ts | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts index fd83bf2ac..6975ca4bb 100644 --- a/server/tests/plugins/action-hooks.ts +++ b/server/tests/plugins/action-hooks.ts | |||
@@ -3,11 +3,8 @@ | |||
3 | import 'mocha' | 3 | import 'mocha' |
4 | import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' | 4 | import { ServerHookName, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models' |
5 | import { | 5 | import { |
6 | addVideoCommentReply, | ||
7 | addVideoCommentThread, | ||
8 | blockUser, | 6 | blockUser, |
9 | createUser, | 7 | createUser, |
10 | deleteVideoComment, | ||
11 | PluginsCommand, | 8 | PluginsCommand, |
12 | registerUser, | 9 | registerUser, |
13 | removeUser, | 10 | removeUser, |
@@ -101,20 +98,20 @@ describe('Test plugin action hooks', function () { | |||
101 | 98 | ||
102 | describe('Comments hooks', function () { | 99 | describe('Comments hooks', function () { |
103 | it('Should run action:api.video-thread.created', async function () { | 100 | it('Should run action:api.video-thread.created', async function () { |
104 | const res = await addVideoCommentThread(servers[0].url, servers[0].accessToken, videoUUID, 'thread') | 101 | const created = await servers[0].commentsCommand.createThread({ videoId: videoUUID, text: 'thread' }) |
105 | threadId = res.body.comment.id | 102 | threadId = created.id |
106 | 103 | ||
107 | await checkHook('action:api.video-thread.created') | 104 | await checkHook('action:api.video-thread.created') |
108 | }) | 105 | }) |
109 | 106 | ||
110 | it('Should run action:api.video-comment-reply.created', async function () { | 107 | it('Should run action:api.video-comment-reply.created', async function () { |
111 | await addVideoCommentReply(servers[0].url, servers[0].accessToken, videoUUID, threadId, 'reply') | 108 | await servers[0].commentsCommand.addReply({ videoId: videoUUID, toCommentId: threadId, text: 'reply' }) |
112 | 109 | ||
113 | await checkHook('action:api.video-comment-reply.created') | 110 | await checkHook('action:api.video-comment-reply.created') |
114 | }) | 111 | }) |
115 | 112 | ||
116 | it('Should run action:api.video-comment.deleted', async function () { | 113 | it('Should run action:api.video-comment.deleted', async function () { |
117 | await deleteVideoComment(servers[0].url, servers[0].accessToken, videoUUID, threadId) | 114 | await servers[0].commentsCommand.delete({ videoId: videoUUID, commentId: threadId }) |
118 | 115 | ||
119 | await checkHook('action:api.video-comment.deleted') | 116 | await checkHook('action:api.video-comment.deleted') |
120 | }) | 117 | }) |