CEC-2654: Map polls for curren visible area (#222)
Update index.jsx Added some tests, still don't meet threshold Co-authored-by: Alexander Andrews <aandrews@fiskerinc.com>
This commit is contained in:
committed by
GitHub
parent
525c1ca6d5
commit
b45c70bd52
@@ -85,11 +85,9 @@ const vehiclesAPI = {
|
||||
data: ["Ocean", "Pear"],
|
||||
};
|
||||
},
|
||||
getLocations: jest
|
||||
.fn()
|
||||
.mockResolvedValue([
|
||||
{ altitude: 5, longitude: 10, latitude: 15, vin: "TESTVIN123" },
|
||||
]),
|
||||
getLocations: async (token, locationFilter) => {
|
||||
return {data:[{ altitude: 0, longitude: 10, latitude: 15, vin: "TESTVIN123"}] }
|
||||
},
|
||||
getVehicle: async (vin) => {
|
||||
const index = data.findIndex(element => element.vin === vin);
|
||||
return data[index];
|
||||
|
||||
@@ -68,13 +68,14 @@ const vehiclesAPI = {
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
getLocations: async (token) =>
|
||||
getLocations: async (token, mapLocationInfo) =>
|
||||
fetch(`${API_ENDPOINT}/carslocations`, {
|
||||
method: "GET",
|
||||
method: "POST",
|
||||
headers: Object.assign(
|
||||
{ "Content-Type": "application/json" },
|
||||
getAuthHeaderOptions(token)
|
||||
),
|
||||
body: JSON.stringify(mapLocationInfo)
|
||||
})
|
||||
.then(fetchRespHandler)
|
||||
.catch(errorHandler),
|
||||
|
||||
Reference in New Issue
Block a user