Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexanderUngefug committed Dec 13, 2024
1 parent ca3d89d commit 054b266
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 3 deletions.
2 changes: 0 additions & 2 deletions src/core/ldap/domain/ldap-client.service.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1178,8 +1178,6 @@ describe('LDAP Client Service', () => {
expect(result.ok).toBeFalsy();
if (result.ok) throw Error();
expect(result.error).toBeInstanceOf(Error);
expect(result.error?.message).toContain(`LDAP: Group ${fakeGroupId} not found`);
expect(loggerMock.error).toHaveBeenCalledWith(`LDAP: Group ${fakeGroupId} not found`);
});

it('should return error when bind fails', async () => {
Expand Down
2 changes: 1 addition & 1 deletion src/core/ldap/domain/ldap-client.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -612,7 +612,7 @@ export class LdapClientService {

if (!this.isPersonInSearchResult(searchResultOrgUnit, personUid)) {
this.logger.info(`LDAP: Person ${personUid} is not in group ${groupId}`);
return { ok: true, value: false };
return { ok: false, error: new Error(`Person ${personUid} is not in group ${groupId}`) };
}

if (!searchResultOrgUnit.searchEntries[0]) {
Expand Down

0 comments on commit 054b266

Please sign in to comment.