1
0
Fork 0
mirror of https://github.com/Chocobozzz/PeerTube.git synced 2025-10-05 02:39:33 +02:00

Add playlist rest tests

This commit is contained in:
Chocobozzz 2019-03-05 10:58:44 +01:00 committed by Chocobozzz
parent 07b1a18aa6
commit df0b219d36
35 changed files with 1485 additions and 756 deletions

View file

@ -11,8 +11,9 @@ import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model'
import { ActorModel } from '../models/activitypub/actor'
import { UserNotificationSettingModel } from '../models/account/user-notification-setting'
import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users'
import { createWatchLaterPlaylist } from './video-playlist'
async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) {
async function createUserAccountAndChannelAndPlaylist (userToCreate: UserModel, validateUser = true) {
const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => {
const userOptions = {
transaction: t,
@ -38,7 +39,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse
}
const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t)
return { user: userCreated, account: accountCreated, videoChannel }
const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t)
return { user: userCreated, account: accountCreated, videoChannel, videoPlaylist }
})
const [ accountKeys, channelKeys ] = await Promise.all([
@ -89,7 +92,7 @@ async function createApplicationActor (applicationId: number) {
export {
createApplicationActor,
createUserAccountAndChannel,
createUserAccountAndChannelAndPlaylist,
createLocalAccountWithoutKeys
}