checkNewVideoFromSubscription,
cleanupTests,
getAllNotificationsSettings,
- getMyUserInformation,
MockSmtpServer,
prepareNotificationsTest,
ServerInfo,
uploadRandomVideo,
waitJobs
} from '@shared/extra-utils'
-import { User, UserNotification, UserNotificationSettingValue } from '@shared/models'
+import { UserNotification, UserNotificationSettingValue } from '@shared/models'
const expect = chai.expect
})
{
- const res = await getMyUserInformation(server.url, userToken)
- const info = res.body as User
+ const info = await server.usersCommand.getMyInfo({ token: userToken })
expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.NONE)
}
const { name, uuid } = await uploadRandomVideo(server)
const check = { web: true, mail: true }
- await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence')
+ await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'absence')
})
it('Should only have web notifications', async function () {
})
{
- const res = await getMyUserInformation(server.url, userToken)
- const info = res.body as User
+ const info = await server.usersCommand.getMyInfo({ token: userToken })
expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.WEB)
}
{
const check = { mail: true, web: false }
- await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence')
+ await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'absence')
}
{
const check = { mail: false, web: true }
- await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'presence')
+ await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'presence')
}
})
})
{
- const res = await getMyUserInformation(server.url, userToken)
- const info = res.body as User
+ const info = await server.usersCommand.getMyInfo({ token: userToken })
expect(info.notificationSettings.newVideoFromSubscription).to.equal(UserNotificationSettingValue.EMAIL)
}
{
const check = { mail: false, web: true }
- await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'absence')
+ await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'absence')
}
{
const check = { mail: true, web: false }
- await checkNewVideoFromSubscription({ ...baseParams, ...check }, name, uuid, 'presence')
+ await checkNewVideoFromSubscription({ ...baseParams, check }, name, uuid, 'presence')
}
})
})
{
- const res = await getMyUserInformation(server.url, userToken)
- const info = res.body as User
+ const info = await server.usersCommand.getMyInfo({ token: userToken })
expect(info.notificationSettings.newVideoFromSubscription).to.equal(
UserNotificationSettingValue.WEB | UserNotificationSettingValue.EMAIL
)