This commit is contained in:
Yadd
2024-01-23 13:59:13 +04:00
committed by GitHub
parent ce595ded5f
commit bf4599c483
2 changed files with 9 additions and 9 deletions
@@ -6,7 +6,7 @@ describe.skip('Lemon LDAP User Provider', () => {
test('ldap returns user info', async () => { test('ldap returns user info', async () => {
const ldap = new LemonLdapUserProvider({ const ldap = new LemonLdapUserProvider({
url: "https://auth.avocat.fr/_getldapentries", url: "https://auth.example.com/_getldapentries",
auth: "", auth: "",
}); });
const user = await ldap.find("999248"); const user = await ldap.find("999248");
@@ -18,23 +18,23 @@ describe.skip('Lemon LDAP User Provider', () => {
test('ldap returns user info with email', async () => { test('ldap returns user info with email', async () => {
const ldap = new LemonLdapUserProvider({ const ldap = new LemonLdapUserProvider({
url: "https://auth.avocat.fr/_getldapentries", url: "https://auth.example.com/_getldapentries",
auth: "", auth: "",
}); });
const user = await ldap.find("999253"); const user = await ldap.find("999253");
expect(user.firstName).toBe("Utilisateur4"); expect(user.firstName).toBe("Utilisateur4");
expect(user.lastName).toBe("ONBOARDING4"); expect(user.lastName).toBe("ONBOARDING4");
expect(user.email).toBe("utilisateur4.onboarding4@avocat.fr"); expect(user.email).toBe("utilisateur4.onboarding4@example.com");
expect(user.uid).toBe("999253"); expect(user.uid).toBe("999253");
}); });
test('ldap returns nothing', async () => { test('ldap returns nothing', async () => {
const ldap = new LemonLdapUserProvider({ const ldap = new LemonLdapUserProvider({
url: "https://auth.avocat.fr/_getldapentries", url: "https://auth.example.com/_getldapentries",
auth: "", auth: "",
}); });
const user = await ldap.find("NOTHING_HERE"); const user = await ldap.find("NOTHING_HERE");
expect(user.email).toBeUndefined(); expect(user.email).toBeUndefined();
}); });
}); });
@@ -7,23 +7,23 @@ describe.skip('Shell LDAP User Provider', () => {
test('ldap returns user info', async () => { test('ldap returns user info', async () => {
const ldap = new ShellLdapUserProvider({ const ldap = new ShellLdapUserProvider({
url: "ldap://auth.poc-mail-avocat.fr:389", url: "ldap://auth.poc-mail-example.com:389",
baseDn: "ou=users,dc=example,dc=com", baseDn: "ou=users,dc=example,dc=com",
} as LdapConfiguration); } as LdapConfiguration);
const user = await ldap.find("999248"); const user = await ldap.find("999248");
expect(user.firstName).toBe("Xavier"); expect(user.firstName).toBe("Xavier");
expect(user.lastName).toBe("GUIMARD"); expect(user.lastName).toBe("GUIMARD");
expect(user.email).toBe("xguimard@preprod-avocat.fr"); expect(user.email).toBe("xguimard@preprod-example.com");
expect(user.uid).toBe("999248"); expect(user.uid).toBe("999248");
}); });
test('ldap returns nothing', async () => { test('ldap returns nothing', async () => {
const ldap = new ShellLdapUserProvider({ const ldap = new ShellLdapUserProvider({
url: "ldap://auth.poc-mail-avocat.fr:389", url: "ldap://auth.poc-mail-example.com:389",
baseDn: "ou=users,dc=example,dc=com", baseDn: "ou=users,dc=example,dc=com",
} as LdapConfiguration); } as LdapConfiguration);
const user = await ldap.find("NOTHING_HERE"); const user = await ldap.find("NOTHING_HERE");
expect(user.email).toBeUndefined(); expect(user.email).toBeUndefined();
}); });
}); });