-
Notifications
You must be signed in to change notification settings - Fork 0
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
0c3a27c
commit b368891
Showing
7 changed files
with
80 additions
and
28 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -36,14 +36,15 @@ | |
|
||
### Parameters | ||
|
||
| Name | Type | Comments | | ||
| ---- | -------- | -------- | | ||
| `q` | `String` | Query | | ||
| Name | Type | Comments | | ||
| ---- | -------- | --------------------------------- | | ||
| `q` | `String` | Query | | ||
| `hl` | `String` | Sets the user interface language. | | ||
|
||
### Examples | ||
|
||
- [/api/ldap?q=278890][ldap-1] | ||
- [/api/ldap?q=[email protected]][ldap-2] | ||
- [/api/ldap?q=[email protected]&hl=en][ldap-2] | ||
|
||
## EPFL Graph | ||
|
||
|
@@ -81,6 +82,6 @@ See [Contributing](CONTRIBUTING.md). | |
[cse-2]: http://127.0.0.1:5555/api/cse?q=math&hl=fr&searchSite=actu.epfl.ch | ||
[cse-3]: http://127.0.0.1:5555/api/cse?q=math&hl=en&sort=date&searchType=image | ||
[ldap-1]: http://127.0.0.1:5555/api/ldap?q=278890 | ||
[ldap-2]: http://127.0.0.1:5555/api/[email protected] | ||
[ldap-2]: http://127.0.0.1:5555/api/[email protected]&hl=en | ||
[graphsearch-1]: http://127.0.0.1:5555/api/graphsearch?q=math | ||
[graphsearch-2]: http://127.0.0.1:5555/api/graphsearch?q=vetterli |
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 |
---|---|---|
|
@@ -30,15 +30,22 @@ describe('Test API People ("/api/ldap")', () => { | |
expect(response.text).toMatch('[]'); | ||
}); | ||
|
||
test('It should find sciper 670001', async () => { | ||
const jsonResult = require('./resources/people/json-sciper-670001.json'); | ||
const response = await request(app).get('/api/ldap?q=670001'); | ||
test('It should find sciper 670001 (fr)', async () => { | ||
const jsonResult = require('./resources/people/json-sciper-670001-fr.json'); | ||
const response = await request(app).get('/api/ldap?q=670001&hl=fr'); | ||
expect(response.statusCode).toBe(200); | ||
expect(JSON.parse(response.text)).toStrictEqual(jsonResult); | ||
}); | ||
|
||
test('It should find sciper 670001 (en)', async () => { | ||
const jsonResult = require('./resources/people/json-sciper-670001-en.json'); | ||
const response = await request(app).get('/api/ldap?q=670001&hl=en'); | ||
expect(response.statusCode).toBe(200); | ||
expect(JSON.parse(response.text)).toStrictEqual(jsonResult); | ||
}); | ||
|
||
test('It should find mail [email protected]', async () => { | ||
const jsonResult = require('./resources/people/json-sciper-670001.json'); | ||
const jsonResult = require('./resources/people/json-sciper-670001-fr.json'); | ||
const response = await request(app).get('/api/[email protected]'); | ||
expect(response.statusCode).toBe(200); | ||
expect(JSON.parse(response.text)).toStrictEqual(jsonResult); | ||
|
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 |
---|---|---|
@@ -0,0 +1,30 @@ | ||
[ | ||
{ | ||
"sciper": "670001", | ||
"rank": 0, | ||
"name": "Fett", | ||
"firstname": "Boba", | ||
"profile": "boba.fett", | ||
"email": "[email protected]", | ||
"accreds": [ | ||
{ | ||
"phoneList": ["+41 21 0000321"], | ||
"officeList": ["Cloud City 016"], | ||
"path": "EPFL/OT/EP-5/BESPIN", | ||
"rank": "1", | ||
"position": "Bounty hunter", | ||
"acronym": "BESPIN", | ||
"name": "Bespin is a gas giant in the star system of the same name." | ||
}, | ||
{ | ||
"phoneList": ["+41 21 0000321"], | ||
"officeList": ["Dune Sea 001"], | ||
"path": "EPFL/OT/EP-6/TATOOINE", | ||
"rank": "2", | ||
"position": "Bounty hunter", | ||
"acronym": "TATOOINE", | ||
"name": "Tatooine is a desert planet located in the Outer Rim territories of the galaxy." | ||
} | ||
] | ||
} | ||
] |
File renamed without changes.