test: make it work again

This commit is contained in:
Girish Ramakrishnan
2025-06-11 14:44:27 +02:00
parent 7744568eb8
commit 8fc9685a1b
3 changed files with 4 additions and 6 deletions

View File

@@ -149,7 +149,7 @@ describe('Directory Server (LDAP)', function () {
it('totp check not requested - fails with bad password', async function () {
const [error] = await safe(ldapBind(`cn=${admin.id},ou=users,dc=cloudron`, admin.password + 'random'));
expect(error).to.be.a(ldap.InvalidCredentialsError);
expect(error.lde_message).to.be('Username and password does not match');
expect(error.lde_message).to.be('Wrong password');
});
it('totp check not requested - succeeds with good password', async function () {
@@ -179,13 +179,13 @@ describe('Directory Server (LDAP)', function () {
it('totp check requested - fails with bad password if user has 2fa', async function () {
const totpToken = speakeasy.totp({ secret: twofa.secret, encoding: 'base32' });
const [error] = await safe(ldapBind(`cn=${admin.email}+totpToken=${totpToken},ou=users,dc=cloudron`, admin.password + 'random'));
expect(error.lde_message).to.be('Username and password does not match');
expect(error.lde_message).to.be('Wrong password');
});
it('totp check requested - fails with bad password if user has no 2fa', async function () {
const totpToken = speakeasy.totp({ secret: twofa.secret, encoding: 'base32' });
const [error] = await safe(ldapBind(`cn=${admin.email}+totpToken=${totpToken},ou=users,dc=cloudron`, admin.password + 'random'));
expect(error.lde_message).to.be('Username and password does not match');
expect(error.lde_message).to.be('Wrong password');
});
it('totp check requested - succeeds with valid 2fa', async function () {