rootAccountId = user.account.id
rootChannelId = user.videoChannels[0].id
}
{
const attr = { username: 'john', password: 'password' }
rootAccountId = user.account.id
rootChannelId = user.videoChannels[0].id
}
{
const attr = { username: 'john', password: 'password' }
- await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: attr.username, password: attr.password })
- userAccessToken = await userLogin(servers[0], attr)
+ await servers[0].usersCommand.create({ username: attr.username, password: attr.password })
+ userAccessToken = await servers[0].loginCommand.getAccessToken(attr)
name: 'my super name for server 1',
description: 'my super description for server 1',
fixture: 'video_short.webm'
}
name: 'my super name for server 1',
description: 'my super description for server 1',
fixture: 'video_short.webm'
}
- await addVideoCommentThread(servers[0].url, servers[0].accessToken, videoId, 'super comment 1')
- await addVideoCommentThread(servers[0].url, servers[0].accessToken, videoId, 'super comment 2')
+ await servers[0].commentsCommand.createThread({ videoId: id, text: 'super comment 1' })
+ await servers[0].commentsCommand.createThread({ videoId: id, text: 'super comment 2' })
- const videoAttributes = { name: 'unlisted video', privacy: VideoPrivacy.UNLISTED }
- const res = await uploadVideo(servers[0].url, servers[0].accessToken, videoAttributes)
- const videoId = res.body.video.id
+ const attributes = { name: 'unlisted video', privacy: VideoPrivacy.UNLISTED }
+ const { id } = await servers[0].videosCommand.upload({ attributes })
- await addVideoCommentThread(servers[0].url, servers[0].accessToken, videoId, 'comment on unlisted video')
+ await servers[0].commentsCommand.createThread({ videoId: id, text: 'comment on unlisted video' })
it('Should list no videos for a user with no videos and no subscriptions', async function () {
const attr = { username: 'feeduser', password: 'password' }
it('Should list no videos for a user with no videos and no subscriptions', async function () {
const attr = { username: 'feeduser', password: 'password' }
- await createUser({ url: servers[0].url, accessToken: servers[0].accessToken, username: attr.username, password: attr.password })
- const feeduserAccessToken = await userLogin(servers[0], attr)
+ await servers[0].usersCommand.create({ username: attr.username, password: attr.password })
+ const feeduserAccessToken = await servers[0].loginCommand.getAccessToken(attr)
- const res = await listUserSubscriptionVideos(servers[0].url, feeduserAccessToken)
- expect(res.body.total).to.equal(0)
+ const body = await servers[0].subscriptionsCommand.listVideos({ token: feeduserAccessToken })
+ expect(body.total).to.equal(0)
const query = { accountId: feeduserAccountId, token: feeduserFeedToken }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
const query = { accountId: feeduserAccountId, token: feeduserFeedToken }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
- const res = await listUserSubscriptionVideos(servers[0].url, userAccessToken)
- expect(res.body.total).to.equal(0)
+ const body = await servers[0].subscriptionsCommand.listVideos({ token: userAccessToken })
+ expect(body.total).to.equal(0)
const query = { accountId: userAccountId, token: userFeedToken }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
const query = { accountId: userAccountId, token: userFeedToken }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
- const res = await listUserSubscriptionVideos(servers[0].url, userAccessToken)
- expect(res.body.total).to.equal(1)
- expect(res.body.data[0].name).to.equal('user video')
+ const body = await servers[0].subscriptionsCommand.listVideos({ token: userAccessToken })
+ expect(body.total).to.equal(1)
+ expect(body.data[0].name).to.equal('user video')
const query = { accountId: userAccountId, token: userFeedToken, version: 1 }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
const query = { accountId: userAccountId, token: userFeedToken, version: 1 }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
- const res = await listUserSubscriptionVideos(servers[0].url, userAccessToken)
- expect(res.body.total).to.equal(2, "there should be 2 videos part of the subscription")
+ const body = await servers[0].subscriptionsCommand.listVideos({ token: userAccessToken })
+ expect(body.total).to.equal(2, "there should be 2 videos part of the subscription")
const query = { accountId: userAccountId, token: userFeedToken, version: 2 }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
const query = { accountId: userAccountId, token: userFeedToken, version: 2 }
const json = await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query })
const query = { accountId: userAccountId, token: userFeedToken, version: 3 }
await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should succeed with the new token', async function () {
const query = { accountId: userAccountId, token: userFeedToken, version: 3 }
await servers[0].feedCommand.getJSON({ feed: 'subscriptions', query, expectedStatus: HttpStatusCode.FORBIDDEN_403 })
})
it('Should succeed with the new token', async function () {
userFeedToken = token.feedToken
const query = { accountId: userAccountId, token: userFeedToken, version: 4 }
userFeedToken = token.feedToken
const query = { accountId: userAccountId, token: userFeedToken, version: 4 }