X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=server%2Ftests%2Fapi%2Fusers%2Fusers.ts;h=95b1bb62603357324217039ab2306bddb00ed7e7;hb=43d0ea7f4b88d52097172cc0c1831edd7e492503;hp=3a3fabb4c5bdb458ca48911e0433a7e1f24a6087;hpb=9b474844e85cce916370693cc24f53339a695570;p=github%2FChocobozzz%2FPeerTube.git diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 3a3fabb4c..95b1bb626 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -442,7 +442,7 @@ describe('Test users', function () { url: server.url, accessToken: accessTokenUser, currentPassword: 'super password', - newPassword: 'new password' + password: 'new password' }) user.password = 'new password' @@ -543,7 +543,7 @@ describe('Test users', function () { }) const res = await getMyUserInformation(server.url, accessTokenUser) - const user = res.body + const user: User = res.body expect(user.username).to.equal('user_1') expect(user.email).to.equal('updated@example.com') @@ -552,6 +552,8 @@ describe('Test users', function () { expect(user.id).to.be.a('number') expect(user.account.displayName).to.equal('new display name') expect(user.account.description).to.equal('my super description updated') + expect(user.noWelcomeModal).to.be.false + expect(user.noInstanceConfigWarningModal).to.be.false }) it('Should be able to update my theme', async function () { @@ -568,6 +570,21 @@ describe('Test users', function () { expect(body.theme).to.equal(theme) } }) + + it('Should be able to update my modal preferences', async function () { + await updateMyUser({ + url: server.url, + accessToken: accessTokenUser, + noInstanceConfigWarningModal: true, + noWelcomeModal: true + }) + + const res = await getMyUserInformation(server.url, accessTokenUser) + const user: User = res.body + + expect(user.noWelcomeModal).to.be.true + expect(user.noInstanceConfigWarningModal).to.be.true + }) }) describe('Updating another user', function () {