-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22a1ba8
commit 8e1569c
Showing
3 changed files
with
16 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -37,16 +37,18 @@ const mockLDAPConfig = { | |
}, | ||
}; | ||
|
||
const createLDAPUserResult = (props) => ({ | ||
dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org', | ||
givenName: 'Max', | ||
sn: 'Mustermann', | ||
uid: 'max.mustermann.1', | ||
uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0', | ||
mail: '[email protected]', | ||
memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org', | ||
...props, | ||
}); | ||
const createLDAPUserResult = (props) => { | ||
return { | ||
dn: 'uid=max.mustermann.1,ou=users,o=school0,dc=de,dc=example,dc=org', | ||
givenName: 'Max', | ||
sn: 'Mustermann', | ||
uid: 'max.mustermann.1', | ||
uuid: 'ZDg0Y2ZlMjMtZGYwNi00MWNjLTg3YmUtZjI3NjA1NDJhY2Y0', | ||
mail: '[email protected]', | ||
memberOf: 'cn=ROLE_STUDENT,ou=roles,o=school0,dc=de,dc=example,dc=org', | ||
...props, | ||
}; | ||
}; | ||
|
||
describe('GeneralLDAPStrategy', () => { | ||
it('implements AbstractLDAPStrategy', () => { | ||
|
@@ -67,10 +69,6 @@ describe('GeneralLDAPStrategy', () => { | |
app.use('/ldap', originalLdapService); | ||
}); | ||
|
||
afterEach(() => { | ||
app.unuse('/ldap'); | ||
}); | ||
|
||
describe('#getSchools', () => { | ||
it('should return school compliant with internal interface', async () => { | ||
const schools = await new GeneralLDAPStrategy(app, mockLDAPConfig).getSchools(); | ||
|
@@ -144,6 +142,7 @@ describe('GeneralLDAPStrategy', () => { | |
|
||
beforeEach(() => { | ||
ldapServiceMock = new MockLdapService(); | ||
app.unuse('/ldap'); | ||
app.use('/ldap', ldapServiceMock); | ||
}); | ||
|
||
|
@@ -270,8 +269,8 @@ describe('GeneralLDAPStrategy', () => { | |
} | ||
|
||
beforeEach(() => { | ||
//app.unuse('/ldap'); | ||
ldapServiceMock = new MockLdapService(); | ||
app.unuse('/ldap'); | ||
app.use('/ldap', ldapServiceMock); | ||
}); | ||
|
||
|