aboutsummaryrefslogtreecommitdiffhomepage
path: root/server/tests
diff options
context:
space:
mode:
Diffstat (limited to 'server/tests')
-rw-r--r--server/tests/api/check-params/users.ts27
-rw-r--r--server/tests/api/users/users.ts5
2 files changed, 18 insertions, 14 deletions
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 () {
491 await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) 491 await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
492 }) 492 })
493 493
494 it('Should fail with an invalid noInstanceConfigWarningModal attribute', async function () { 494 it('Should fail with invalid no modal attributes', async function () {
495 const fields = { 495 const keys = [
496 noInstanceConfigWarningModal: -1 496 'noInstanceConfigWarningModal',
497 } 497 'noAccountSetupWarningModal',
498 498 'noWelcomeModal'
499 await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields }) 499 ]
500 }) 500
501 for (const key of keys) {
502 const fields = {
503 [key]: -1
504 }
501 505
502 it('Should fail with an invalid noWelcomeModal attribute', async function () { 506 await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
503 const fields = {
504 noWelcomeModal: -1
505 } 507 }
506
507 await makePutBodyRequest({ url: server.url, path: path + 'me', token: userToken, fields })
508 }) 508 })
509 509
510 it('Should succeed to change password with the correct params', async function () { 510 it('Should succeed to change password with the correct params', async function () {
@@ -516,7 +516,8 @@ describe('Test users API validators', function () {
516 email: 'super_email@example.com', 516 email: 'super_email@example.com',
517 theme: 'default', 517 theme: 'default',
518 noInstanceConfigWarningModal: true, 518 noInstanceConfigWarningModal: true,
519 noWelcomeModal: true 519 noWelcomeModal: true,
520 noAccountSetupWarningModal: true
520 } 521 }
521 522
522 await makePutBodyRequest({ 523 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 () {
597 expect(user.account.description).to.equal('my super description updated') 597 expect(user.account.description).to.equal('my super description updated')
598 expect(user.noWelcomeModal).to.be.false 598 expect(user.noWelcomeModal).to.be.false
599 expect(user.noInstanceConfigWarningModal).to.be.false 599 expect(user.noInstanceConfigWarningModal).to.be.false
600 expect(user.noAccountSetupWarningModal).to.be.false
600 }) 601 })
601 602
602 it('Should be able to update my theme', async function () { 603 it('Should be able to update my theme', async function () {
@@ -612,12 +613,14 @@ describe('Test users', function () {
612 await server.users.updateMe({ 613 await server.users.updateMe({
613 token: userToken, 614 token: userToken,
614 noInstanceConfigWarningModal: true, 615 noInstanceConfigWarningModal: true,
615 noWelcomeModal: true 616 noWelcomeModal: true,
617 noAccountSetupWarningModal: true
616 }) 618 })
617 619
618 const user = await server.users.getMyInfo({ token: userToken }) 620 const user = await server.users.getMyInfo({ token: userToken })
619 expect(user.noWelcomeModal).to.be.true 621 expect(user.noWelcomeModal).to.be.true
620 expect(user.noInstanceConfigWarningModal).to.be.true 622 expect(user.noInstanceConfigWarningModal).to.be.true
623 expect(user.noAccountSetupWarningModal).to.be.true
621 }) 624 })
622 }) 625 })
623 626