+ it('Should auto blacklist a video on URL import', async function () {
+ this.timeout(15000)
+
+ const attributes = {
+ targetUrl: getYoutubeVideoUrl(),
+ name: 'URL import',
+ channelId: channelOfUserWithoutFlag
+ }
+ await importVideo(servers[0].url, userWithoutFlag, attributes)
+
+ const res = await getBlacklistedVideosList({
+ url: servers[0].url,
+ token: servers[0].accessToken,
+ sort: 'createdAt',
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
+ })
+
+ expect(res.body.total).to.equal(2)
+ expect(res.body.data[1].video.name).to.equal('URL import')
+ })
+
+ it('Should auto blacklist a video on torrent import', async function () {
+ const attributes = {
+ magnetUri: getMagnetURI(),
+ name: 'Torrent import',
+ channelId: channelOfUserWithoutFlag
+ }
+ await importVideo(servers[0].url, userWithoutFlag, attributes)
+
+ const res = await getBlacklistedVideosList({
+ url: servers[0].url,
+ token: servers[0].accessToken,
+ sort: 'createdAt',
+ type: VideoBlacklistType.AUTO_BEFORE_PUBLISHED
+ })
+
+ expect(res.body.total).to.equal(3)
+ expect(res.body.data[2].video.name).to.equal('Torrent import')
+ })
+
+ it('Should not auto blacklist a video on upload if the user has the bypass blacklist flag', async function () {