add test for detaill POI
This commit is contained in:
parent
4e2803fcdb
commit
a05fb87f85
@ -108,4 +108,62 @@ describe("Test the otm city path", () => {
|
||||
});
|
||||
})
|
||||
|
||||
test("It should response the 200 code for GET method", done => {
|
||||
request(app)
|
||||
.get("/otm/poidetaill")
|
||||
.query({'id':'562635'})
|
||||
.then(response => {
|
||||
expect(response.statusCode).toBe(200);
|
||||
done();
|
||||
});
|
||||
});
|
||||
|
||||
test("Get bar in radius from API", done => {
|
||||
const out = {
|
||||
"xid": "N4032296324",
|
||||
"name": "Le 27 point carré",
|
||||
"address": {
|
||||
"road": "Rue Raymond Poincaré",
|
||||
"town": "La Roche-sur-Yon",
|
||||
"state": "Pays de la Loire",
|
||||
"county": "La Roche-sur-Yon",
|
||||
"suburb": "Zola",
|
||||
"country": "France",
|
||||
"postcode": "85000",
|
||||
"country_code": "fr",
|
||||
"house_number": "27",
|
||||
"neighbourhood": "Cité des Forges"
|
||||
},
|
||||
"rate": "1",
|
||||
"osm": "node/4032296324",
|
||||
"kinds": "foods,bars,tourist_facilities",
|
||||
"sources": {
|
||||
"geometry": "osm",
|
||||
"attributes": [
|
||||
"osm"
|
||||
]
|
||||
},
|
||||
"otm": "https://opentripmap.com/en/card/N4032296324",
|
||||
"point": {
|
||||
"lon": -1.4344594478607178,
|
||||
"lat": 46.66864776611328
|
||||
}
|
||||
}
|
||||
request(app)
|
||||
.get("/otm/poidetaill")
|
||||
.query({'id':'562635'})
|
||||
.then(response => {
|
||||
expect(response.text).toEqual(JSON.stringify(out));
|
||||
done();
|
||||
});
|
||||
})
|
||||
|
||||
test("It should response the 200 code for GET method", done => {
|
||||
request(app)
|
||||
.get("/otm/poidetaill")
|
||||
.then(response => {
|
||||
expect(response.statusCode).toBe(400);
|
||||
done();
|
||||
});
|
||||
});
|
||||
});
|
Loading…
x
Reference in New Issue
Block a user