diff options
Diffstat (limited to 'server/tests/plugins/action-hooks.ts')
-rw-r--r-- | server/tests/plugins/action-hooks.ts | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/server/tests/plugins/action-hooks.ts b/server/tests/plugins/action-hooks.ts index 57ede2701..209db95a4 100644 --- a/server/tests/plugins/action-hooks.ts +++ b/server/tests/plugins/action-hooks.ts | |||
@@ -65,6 +65,39 @@ describe('Test plugin action hooks', function () { | |||
65 | 65 | ||
66 | await checkHook('action:api.video.viewed') | 66 | await checkHook('action:api.video.viewed') |
67 | }) | 67 | }) |
68 | |||
69 | it('Should run action:api.video.deleted', async function () { | ||
70 | await servers[0].videos.remove({ id: videoUUID }) | ||
71 | |||
72 | await checkHook('action:api.video.deleted') | ||
73 | }) | ||
74 | |||
75 | after(async function () { | ||
76 | const { uuid } = await servers[0].videos.quickUpload({ name: 'video' }) | ||
77 | videoUUID = uuid | ||
78 | }) | ||
79 | }) | ||
80 | |||
81 | describe('Video channel hooks', function () { | ||
82 | const channelName = 'my_super_channel' | ||
83 | |||
84 | it('Should run action:api.video-channel.created', async function () { | ||
85 | await servers[0].channels.create({ attributes: { name: channelName } }) | ||
86 | |||
87 | await checkHook('action:api.video-channel.created') | ||
88 | }) | ||
89 | |||
90 | it('Should run action:api.video-channel.updated', async function () { | ||
91 | await servers[0].channels.update({ channelName, attributes: { displayName: 'my display name' } }) | ||
92 | |||
93 | await checkHook('action:api.video-channel.updated') | ||
94 | }) | ||
95 | |||
96 | it('Should run action:api.video-channel.deleted', async function () { | ||
97 | await servers[0].channels.delete({ channelName }) | ||
98 | |||
99 | await checkHook('action:api.video-channel.deleted') | ||
100 | }) | ||
68 | }) | 101 | }) |
69 | 102 | ||
70 | describe('Live hooks', function () { | 103 | describe('Live hooks', function () { |