diff options
author | Chocobozzz <me@florianbigard.com> | 2019-03-05 10:58:44 +0100 |
---|---|---|
committer | Chocobozzz <chocobozzz@cpy.re> | 2019-03-18 11:17:59 +0100 |
commit | df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa (patch) | |
tree | c4984e854f5dc18e5c27afd73b843bd52c143034 /server/lib/user.ts | |
parent | 07b1a18aa678d260009a93e36606c5c5f585723d (diff) | |
download | PeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.tar.gz PeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.tar.zst PeerTube-df0b219d36bf6852cdf2a7ad09ed4a41c6bccefa.zip |
Add playlist rest tests
Diffstat (limited to 'server/lib/user.ts')
-rw-r--r-- | server/lib/user.ts | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/server/lib/user.ts b/server/lib/user.ts index a39ef6c3d..02a84f15b 100644 --- a/server/lib/user.ts +++ b/server/lib/user.ts | |||
@@ -11,8 +11,9 @@ import { FilteredModelAttributes } from 'sequelize-typescript/lib/models/Model' | |||
11 | import { ActorModel } from '../models/activitypub/actor' | 11 | import { ActorModel } from '../models/activitypub/actor' |
12 | import { UserNotificationSettingModel } from '../models/account/user-notification-setting' | 12 | import { UserNotificationSettingModel } from '../models/account/user-notification-setting' |
13 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' | 13 | import { UserNotificationSetting, UserNotificationSettingValue } from '../../shared/models/users' |
14 | import { createWatchLaterPlaylist } from './video-playlist' | ||
14 | 15 | ||
15 | async function createUserAccountAndChannel (userToCreate: UserModel, validateUser = true) { | 16 | async function createUserAccountAndChannelAndPlaylist (userToCreate: UserModel, validateUser = true) { |
16 | const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { | 17 | const { user, account, videoChannel } = await sequelizeTypescript.transaction(async t => { |
17 | const userOptions = { | 18 | const userOptions = { |
18 | transaction: t, | 19 | transaction: t, |
@@ -38,7 +39,9 @@ async function createUserAccountAndChannel (userToCreate: UserModel, validateUse | |||
38 | } | 39 | } |
39 | const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) | 40 | const videoChannel = await createVideoChannel(videoChannelInfo, accountCreated, t) |
40 | 41 | ||
41 | return { user: userCreated, account: accountCreated, videoChannel } | 42 | const videoPlaylist = await createWatchLaterPlaylist(accountCreated, t) |
43 | |||
44 | return { user: userCreated, account: accountCreated, videoChannel, videoPlaylist } | ||
42 | }) | 45 | }) |
43 | 46 | ||
44 | const [ accountKeys, channelKeys ] = await Promise.all([ | 47 | const [ accountKeys, channelKeys ] = await Promise.all([ |
@@ -89,7 +92,7 @@ async function createApplicationActor (applicationId: number) { | |||
89 | 92 | ||
90 | export { | 93 | export { |
91 | createApplicationActor, | 94 | createApplicationActor, |
92 | createUserAccountAndChannel, | 95 | createUserAccountAndChannelAndPlaylist, |
93 | createLocalAccountWithoutKeys | 96 | createLocalAccountWithoutKeys |
94 | } | 97 | } |
95 | 98 | ||