From 9e5cf66be7ad897e106f283bee73a165c72e74de Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Fri, 28 Oct 2022 16:15:04 +0200 Subject: Breaking API: Consistency with role id/label --- server/tests/plugins/external-auth.ts | 6 +++--- server/tests/plugins/id-and-pass-auth.ts | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) (limited to 'server/tests/plugins') diff --git a/server/tests/plugins/external-auth.ts b/server/tests/plugins/external-auth.ts index e08b83791..437777e90 100644 --- a/server/tests/plugins/external-auth.ts +++ b/server/tests/plugins/external-auth.ts @@ -155,7 +155,7 @@ describe('Test external auth plugins', function () { expect(body.username).to.equal('cyan') expect(body.account.displayName).to.equal('cyan') expect(body.email).to.equal('cyan@example.com') - expect(body.role).to.equal(UserRole.USER) + expect(body.role.id).to.equal(UserRole.USER) } }) @@ -177,7 +177,7 @@ describe('Test external auth plugins', function () { expect(body.username).to.equal('kefka') expect(body.account.displayName).to.equal('Kefka Palazzo') expect(body.email).to.equal('kefka@example.com') - expect(body.role).to.equal(UserRole.ADMINISTRATOR) + expect(body.role.id).to.equal(UserRole.ADMINISTRATOR) } }) @@ -237,7 +237,7 @@ describe('Test external auth plugins', function () { expect(body.username).to.equal('cyan') expect(body.account.displayName).to.equal('Cyan Garamonde') expect(body.account.description).to.equal('Retainer to the king of Doma') - expect(body.role).to.equal(UserRole.USER) + expect(body.role.id).to.equal(UserRole.USER) }) it('Should not update an external auth email', async function () { diff --git a/server/tests/plugins/id-and-pass-auth.ts b/server/tests/plugins/id-and-pass-auth.ts index 85faac5a8..fc24a5656 100644 --- a/server/tests/plugins/id-and-pass-auth.ts +++ b/server/tests/plugins/id-and-pass-auth.ts @@ -48,7 +48,7 @@ describe('Test id and pass auth plugins', function () { expect(body.username).to.equal('spyro') expect(body.account.displayName).to.equal('Spyro the Dragon') - expect(body.role).to.equal(UserRole.USER) + expect(body.role.id).to.equal(UserRole.USER) }) it('Should login Crash, create the user and use the token', async function () { @@ -63,7 +63,7 @@ describe('Test id and pass auth plugins', function () { expect(body.username).to.equal('crash') expect(body.account.displayName).to.equal('Crash Bandicoot') - expect(body.role).to.equal(UserRole.MODERATOR) + expect(body.role.id).to.equal(UserRole.MODERATOR) } }) @@ -79,7 +79,7 @@ describe('Test id and pass auth plugins', function () { expect(body.username).to.equal('laguna') expect(body.account.displayName).to.equal('laguna') - expect(body.role).to.equal(UserRole.USER) + expect(body.role.id).to.equal(UserRole.USER) } }) @@ -129,7 +129,7 @@ describe('Test id and pass auth plugins', function () { expect(body.username).to.equal('crash') expect(body.account.displayName).to.equal('Beautiful Crash') expect(body.account.description).to.equal('Mutant eastern barred bandicoot') - expect(body.role).to.equal(UserRole.MODERATOR) + expect(body.role.id).to.equal(UserRole.MODERATOR) }) it('Should reject token of laguna by the plugin hook', async function () { -- cgit v1.2.3