From 8f581725651c4b2c213d75fc028e306bbf239d3e Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 27 Aug 2021 10:15:55 +0200 Subject: Allow accounts to skip account setup modal --- server/tests/api/check-params/users.ts | 27 ++++++++++++++------------- server/tests/api/users/users.ts | 5 ++++- 2 files changed, 18 insertions(+), 14 deletions(-) (limited to 'server/tests/api') diff --git a/server/tests/api/check-params/users.ts b/server/tests/api/check-params/users.ts index 9d8f933db..58b360f92 100644 --- a/server/tests/api/check-params/users.ts +++ b/server/tests/api/check-params/users.ts @@ -491,20 +491,20 @@ describe('Test users API validators', function () { await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) }) - it('Should fail with an invalid noInstanceConfigWarningModal attribute', async function () { - const fields = { - noInstanceConfigWarningModal: -1 - } - - await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) - }) + it('Should fail with invalid no modal attributes', async function () { + const keys = [ + 'noInstanceConfigWarningModal', + 'noAccountSetupWarningModal', + 'noWelcomeModal' + ] + + for (const key of keys) { + const fields = { + [key]: -1 + } - it('Should fail with an invalid noWelcomeModal attribute', async function () { - const fields = { - noWelcomeModal: -1 + await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) } - - await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) }) it('Should succeed to change password with the correct params', async function () { @@ -516,7 +516,8 @@ describe('Test users API validators', function () { email: 'super_email@example.com', theme: 'default', noInstanceConfigWarningModal: true, - noWelcomeModal: true + noWelcomeModal: true, + noAccountSetupWarningModal: true } await makePutBodyRequest({ diff --git a/server/tests/api/users/users.ts b/server/tests/api/users/users.ts index 318ff832a..085d9d870 100644 --- a/server/tests/api/users/users.ts +++ b/server/tests/api/users/users.ts @@ -597,6 +597,7 @@ describe('Test users', function () { expect(user.account.description).to.equal('my super description updated') expect(user.noWelcomeModal).to.be.false expect(user.noInstanceConfigWarningModal).to.be.false + expect(user.noAccountSetupWarningModal).to.be.false }) it('Should be able to update my theme', async function () { @@ -612,12 +613,14 @@ describe('Test users', function () { await server.users.updateMe({ token: userToken, noInstanceConfigWarningModal: true, - noWelcomeModal: true + noWelcomeModal: true, + noAccountSetupWarningModal: true }) const user = await server.users.getMyInfo({ token: userToken }) expect(user.noWelcomeModal).to.be.true expect(user.noInstanceConfigWarningModal).to.be.true + expect(user.noAccountSetupWarningModal).to.be.true }) }) -- cgit v1.2.3