import 'mocha'
import * as chai from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
import {
cleanupTests,
- doubleFollow,
createMultipleServers,
- ImportsCommand,
+ doubleFollow,
+ FIXTURE_URLS,
makeRawRequest,
- PluginsCommand,
PeerTubeServer,
+ PluginsCommand,
setAccessTokensToServers,
setDefaultVideoChannel,
waitJobs
} from '@shared/extra-utils'
-import { VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
+import { HttpStatusCode, VideoDetails, VideoImportState, VideoPlaylist, VideoPlaylistPrivacy, VideoPrivacy } from '@shared/models'
const expect = chai.expect
})
it('Should run filter:api.accounts.videos.list.params', async function () {
- const { data } = await servers[0].videos.listByAccount({ accountName: 'root', start: 0, count: 2 })
+ const { data } = await servers[0].videos.listByAccount({ handle: 'root', start: 0, count: 2 })
// 1 plugin do +1 to the count parameter
expect(data).to.have.lengthOf(3)
})
it('Should run filter:api.accounts.videos.list.result', async function () {
- const { total } = await servers[0].videos.listByAccount({ accountName: 'root', start: 0, count: 2 })
+ const { total } = await servers[0].videos.listByAccount({ handle: 'root', start: 0, count: 2 })
// Plugin do +2 to the total result
expect(total).to.equal(12)
})
it('Should run filter:api.video-channels.videos.list.params', async function () {
- const { data } = await servers[0].videos.listByChannel({ videoChannelName: 'root_channel', start: 0, count: 2 })
+ const { data } = await servers[0].videos.listByChannel({ handle: 'root_channel', start: 0, count: 2 })
// 1 plugin do +3 to the count parameter
expect(data).to.have.lengthOf(5)
})
it('Should run filter:api.video-channels.videos.list.result', async function () {
- const { total } = await servers[0].videos.listByChannel({ videoChannelName: 'root_channel', start: 0, count: 2 })
+ const { total } = await servers[0].videos.listByChannel({ handle: 'root_channel', start: 0, count: 2 })
// Plugin do +3 to the total result
expect(total).to.equal(13)
name: 'normal title',
privacy: VideoPrivacy.PUBLIC,
channelId: servers[0].store.channel.id,
- targetUrl: ImportsCommand.getGoodVideoUrl() + 'bad'
+ targetUrl: FIXTURE_URLS.goodVideo + 'bad'
}
await servers[0].imports.importVideo({ attributes, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
name: 'title with bad word',
privacy: VideoPrivacy.PUBLIC,
channelId: servers[0].store.channel.id,
- targetUrl: ImportsCommand.getGoodVideoUrl()
+ targetUrl: FIXTURE_URLS.goodVideo
}
const body = await servers[0].imports.importVideo({ attributes })
videoImportId = body.id
const attributes = {
name: 'video please blacklist me',
- targetUrl: ImportsCommand.getGoodVideoUrl(),
+ targetUrl: FIXTURE_URLS.goodVideo,
channelId: servers[0].store.channel.id
}
const body = await servers[0].imports.importVideo({ attributes })