/* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
-import 'mocha'
import { expect } from 'chai'
-import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers, wait } from '@shared/extra-utils'
+import { wait } from '@shared/core-utils'
import { HttpStatusCode, UserRole } from '@shared/models'
+import { cleanupTests, createSingleServer, PeerTubeServer, PluginsCommand, setAccessTokensToServers } from '@shared/server-commands'
describe('Test id and pass auth plugins', function () {
let server: PeerTubeServer
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 () {
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)
}
})
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)
}
})
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 () {