]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/plugins/id-and-pass-auth.ts
Breaking API: Consistency with role id/label
[github/Chocobozzz/PeerTube.git] / server / tests / plugins / id-and-pass-auth.ts
index e72046ce25267ea807e3e6a579813a1d2eec1c15..fc24a56564b2a5f638446257a333a028c5752b3e 100644 (file)
@@ -1,6 +1,5 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
 import { wait } from '@shared/core-utils'
 import { HttpStatusCode, UserRole } from '@shared/models'
@@ -49,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 () {
@@ -64,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)
     }
   })
 
@@ -80,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)
     }
   })
 
@@ -130,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 () {