]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - server/tests/external-plugins/auth-ldap.ts
Bumped to version v5.2.1
[github/Chocobozzz/PeerTube.git] / server / tests / external-plugins / auth-ldap.ts
index aaaf232783aa27436a6278587ea8fe0cbca2dcc3..d51d337be77cad6bde42cd86cefcdccda645ecf8 100644 (file)
@@ -1,9 +1,8 @@
 /* eslint-disable @typescript-eslint/no-unused-expressions,@typescript-eslint/require-await */
 
-import 'mocha'
 import { expect } from 'chai'
-import { HttpStatusCode } from '@shared/core-utils'
-import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/extra-utils'
+import { cleanupTests, createSingleServer, PeerTubeServer, setAccessTokensToServers } from '@shared/server-commands'
+import { HttpStatusCode } from '@shared/models'
 
 describe('Official plugin auth-ldap', function () {
   let server: PeerTubeServer
@@ -33,7 +32,7 @@ describe('Official plugin auth-ldap', function () {
         'mail-property': 'mail',
         'search-base': 'ou=people,dc=planetexpress,dc=com',
         'search-filter': '(|(mail={{username}})(uid={{username}}))',
-        'url': 'ldap://localhost:390',
+        'url': 'ldap://127.0.0.1:390',
         'username-property': 'uid'
       }
     })
@@ -51,7 +50,7 @@ describe('Official plugin auth-ldap', function () {
         'mail-property': 'mail',
         'search-base': 'ou=people,dc=planetexpress,dc=com',
         'search-filter': '(|(mail={{username}})(uid={{username}}))',
-        'url': 'ldap://localhost:10389',
+        'url': 'ldap://127.0.0.1:10389',
         'username-property': 'uid'
       }
     })
@@ -95,6 +94,14 @@ describe('Official plugin auth-ldap', function () {
     await server.login.login({ user: { username: 'fry@planetexpress.com', password: 'fry' } })
   })
 
+  it('Should not be able to ask password reset', async function () {
+    await server.users.askResetPassword({ email: 'fry@planetexpress.com', expectedStatus: HttpStatusCode.CONFLICT_409 })
+  })
+
+  it('Should not be able to ask email verification', async function () {
+    await server.users.askSendVerifyEmail({ email: 'fry@planetexpress.com', expectedStatus: HttpStatusCode.CONFLICT_409 })
+  })
+
   it('Should not login if the plugin is uninstalled', async function () {
     await server.plugins.uninstall({ npmName: 'peertube-plugin-auth-ldap' })