createSingleServer,
doubleFollow,
makeGetRequest,
+ makeRawRequest,
PeerTubeServer,
setAccessTokensToServers,
setDefaultChannelAvatar,
chai.use(require('chai-xml'))
chai.use(require('chai-json-schema'))
chai.config.includeStack = true
+
const expect = chai.expect
describe('Test syndication feeds', () => {
const jsonObj = JSON.parse(json)
expect(jsonObj.items.length).to.be.equal(1)
expect(jsonObj.items[0].title).to.equal('my super name for server 1')
- expect(jsonObj.items[0].author.name).to.equal('root')
+ expect(jsonObj.items[0].author.name).to.equal('Main root channel')
}
{
const jsonObj = JSON.parse(json)
expect(jsonObj.items.length).to.be.equal(1)
expect(jsonObj.items[0].title).to.equal('user video')
- expect(jsonObj.items[0].author.name).to.equal('john')
+ expect(jsonObj.items[0].author.name).to.equal('Main john channel')
}
for (const server of servers) {
const jsonObj = JSON.parse(json)
expect(jsonObj.items.length).to.be.equal(1)
expect(jsonObj.items[0].title).to.equal('my super name for server 1')
- expect(jsonObj.items[0].author.name).to.equal('root')
+ expect(jsonObj.items[0].author.name).to.equal('Main root channel')
}
{
const jsonObj = JSON.parse(json)
expect(jsonObj.items.length).to.be.equal(1)
expect(jsonObj.items[0].title).to.equal('user video')
- expect(jsonObj.items[0].author.name).to.equal('john')
+ expect(jsonObj.items[0].author.name).to.equal('Main john channel')
}
for (const server of servers) {
await stopFfmpeg(ffmpeg)
})
+
+ it('Should have the channel avatar as feed icon', async function () {
+ const json = await servers[0].feed.getJSON({ feed: 'videos', query: { videoChannelId: rootChannelId }, ignoreCache: true })
+
+ const jsonObj = JSON.parse(json)
+ const imageUrl = jsonObj.icon
+ expect(imageUrl).to.include('/lazy-static/avatars/')
+ await makeRawRequest({ url: imageUrl, expectedStatus: HttpStatusCode.OK_200 })
+ })
})
describe('Video comments feed', function () {
}
{
- const body = await servers[0].subscriptions.listVideos({ token: feeduserAccessToken })
+ const body = await servers[0].videos.listMySubscriptionVideos({ token: feeduserAccessToken })
expect(body.total).to.equal(0)
const query = { accountId: feeduserAccountId, token: feeduserFeedToken }
})
it('Should list no videos for a user with videos but no subscriptions', async function () {
- const body = await servers[0].subscriptions.listVideos({ token: userAccessToken })
+ const body = await servers[0].videos.listMySubscriptionVideos({ token: userAccessToken })
expect(body.total).to.equal(0)
const query = { accountId: userAccountId, token: userFeedToken }
await waitJobs(servers)
{
- const body = await servers[0].subscriptions.listVideos({ token: userAccessToken })
+ const body = await servers[0].videos.listMySubscriptionVideos({ token: userAccessToken })
expect(body.total).to.equal(1)
expect(body.data[0].name).to.equal('user video')
await waitJobs(servers)
{
- const body = await servers[0].subscriptions.listVideos({ token: userAccessToken })
+ const body = await servers[0].videos.listMySubscriptionVideos({ token: userAccessToken })
expect(body.total).to.equal(2, 'there should be 2 videos part of the subscription')
const query = { accountId: userAccountId, token: userFeedToken }