aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests/api/videos/video-channel-syncs.ts
diff options
context:
space:
mode:
authorChocobozzz <me@florianbigard.com>2022-08-10 11:51:13 +0200
committerChocobozzz <me@florianbigard.com>2022-08-10 14:32:00 +0200
commita3b472a12ec6e57dbe2f650419f8064864686eab (patch)
treef36559488e34493c029b686772e986902150a647 /server/tests/api/videos/video-channel-syncs.ts
parent0567049a9819d67070aa6d548a75a7e632a4aaa4 (diff)
downloadPeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.gz
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.tar.zst
PeerTube-a3b472a12ec6e57dbe2f650419f8064864686eab.zip
Add ability to list imports of a channel sync
Diffstat (limited to 'server/tests/api/videos/video-channel-syncs.ts')
-rw-r--r--server/tests/api/videos/video-channel-syncs.ts12
1 files changed, 12 insertions, 0 deletions
diff --git a/server/tests/api/videos/video-channel-syncs.ts b/server/tests/api/videos/video-channel-syncs.ts
index 229c01f68..835d3cb09 100644
--- a/server/tests/api/videos/video-channel-syncs.ts
+++ b/server/tests/api/videos/video-channel-syncs.ts
@@ -23,7 +23,10 @@ describe('Test channel synchronizations', function () {
23 describe('Sync using ' + mode, function () { 23 describe('Sync using ' + mode, function () {
24 let server: PeerTubeServer 24 let server: PeerTubeServer
25 let command: ChannelSyncsCommand 25 let command: ChannelSyncsCommand
26
26 let startTestDate: Date 27 let startTestDate: Date
28
29 let rootChannelSyncId: number
27 const userInfo = { 30 const userInfo = {
28 accessToken: '', 31 accessToken: '',
29 username: 'user1', 32 username: 'user1',
@@ -90,6 +93,7 @@ describe('Test channel synchronizations', function () {
90 token: server.accessToken, 93 token: server.accessToken,
91 expectedStatus: HttpStatusCode.OK_200 94 expectedStatus: HttpStatusCode.OK_200
92 }) 95 })
96 rootChannelSyncId = videoChannelSync.id
93 97
94 // Ensure any missing video not already fetched will be considered as new 98 // Ensure any missing video not already fetched will be considered as new
95 await changeDateForSync(videoChannelSync.id, '1970-01-01') 99 await changeDateForSync(videoChannelSync.id, '1970-01-01')
@@ -208,6 +212,14 @@ describe('Test channel synchronizations', function () {
208 } 212 }
209 }) 213 })
210 214
215 it('Should list imports of a channel synchronization', async function () {
216 const { total, data } = await server.imports.getMyVideoImports({ videoChannelSyncId: rootChannelSyncId })
217
218 expect(total).to.equal(1)
219 expect(data).to.have.lengthOf(1)
220 expect(data[0].video.name).to.equal('test')
221 })
222
211 it('Should remove user\'s channel synchronizations', async function () { 223 it('Should remove user\'s channel synchronizations', async function () {
212 await command.delete({ channelSyncId: userInfo.syncId }) 224 await command.delete({ channelSyncId: userInfo.syncId })
213 225