} from '../../../../shared/extra-utils'
import { Video, VideoPrivacy } from '../../../../shared/models/videos'
import { UserRole } from '../../../../shared/models/users'
+import { HttpStatusCode } from '../../../../shared/core-utils/miscs/http-error-codes'
const expect = chai.expect
-async function getVideosNames (server: ServerInfo, token: string, filter: string, statusCodeExpected = 200) {
+async function getVideosNames (server: ServerInfo, token: string, filter: string, statusCodeExpected = HttpStatusCode.OK_200) {
const paths = [
'/api/v1/video-channels/root_channel/videos',
'/api/v1/accounts/root/videos',
}
}
})
+
+ it('Should display all videos by the admin or the moderator', async function () {
+ for (const server of servers) {
+ for (const token of [ server.accessToken, server['moderatorAccessToken'] ]) {
+
+ const [ channelVideos, accountVideos, videos, searchVideos ] = await getVideosNames(server, token, 'all')
+ expect(channelVideos).to.have.lengthOf(3)
+ expect(accountVideos).to.have.lengthOf(3)
+
+ expect(videos).to.have.lengthOf(5)
+ expect(searchVideos).to.have.lengthOf(5)
+ }
+ }
+ })
})
after(async function () {