feat: open-trip-api-drink #11

Merged
Clement merged 34 commits from feat/open-trip-api into master 2024-05-19 09:38:39 +00:00
Showing only changes of commit a05fb87f85 - Show all commits

View File

@ -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();
});
});
}); });