let kefkaAccessToken: string
let kefkaRefreshToken: string
+ let kefkaId: number
let externalAuthToken: string
expect(body.adminFlags).to.equal(UserAdminFlag.BYPASS_VIDEO_AUTO_BLACKLIST)
expect(body.videoQuota).to.equal(42000)
expect(body.videoQuotaDaily).to.equal(42100)
+
+ kefkaId = body.id
}
})
expect(body.role.id).to.equal(UserRole.USER)
})
+ it('Should login Kefka and update the profile', async function () {
+ {
+ await server.users.update({ userId: kefkaId, videoQuota: 43000, videoQuotaDaily: 43100 })
+ await server.users.updateMe({ token: kefkaAccessToken, displayName: 'kefka updated' })
+
+ const body = await server.users.getMyInfo({ token: kefkaAccessToken })
+ expect(body.username).to.equal('kefka')
+ expect(body.account.displayName).to.equal('kefka updated')
+ expect(body.videoQuota).to.equal(43000)
+ expect(body.videoQuotaDaily).to.equal(43100)
+ }
+
+ {
+ const res = await loginExternal({
+ server,
+ npmName: 'test-external-auth-one',
+ authName: 'external-auth-2',
+ username: 'kefka'
+ })
+
+ kefkaAccessToken = res.access_token
+ kefkaRefreshToken = res.refresh_token
+
+ const body = await server.users.getMyInfo({ token: kefkaAccessToken })
+ expect(body.username).to.equal('kefka')
+ expect(body.account.displayName).to.equal('Kefka Palazzo')
+ expect(body.videoQuota).to.equal(42000)
+ expect(body.videoQuotaDaily).to.equal(43100)
+ }
+ })
+
it('Should not update an external auth email', async function () {
await server.users.updateMe({
token: cyanAccessToken,