}) {
const { accountId, channelId, start, count, sort, search, isLive } = options
- function buildBaseQuery (): FindOptions {
+ function buildBaseQuery (forCount: boolean): FindOptions {
const where: WhereOptions = {}
if (search) {
where: channelWhere,
include: [
{
- model: AccountModel,
+ model: forCount
+ ? AccountModel.unscoped()
+ : AccountModel,
where: {
id: accountId
},
return baseQuery
}
- const countQuery = buildBaseQuery()
- const findQuery = buildBaseQuery()
+ const countQuery = buildBaseQuery(true)
+ const findQuery = buildBaseQuery(false)
const findScopes: (string | ScopeOptions)[] = [
ScopeNames.WITH_SCHEDULED_UPDATE,
}
})
+ it('Should still have the same amount of videos in my account', async function () {
+ const { total, data } = await server.videos.listMyVideos({ token: userToken })
+
+ expect(total).to.equal(2)
+ expect(data).to.have.lengthOf(2)
+ })
+
it('Should be able to update my display name', async function () {
await server.users.updateMe({ token: userToken, displayName: 'new display name' })