Skip to content

Commit

Permalink
Merge pull request #1637 from HSLdevcom/fix-get-geocoding-function-call
Browse files Browse the repository at this point in the history
call with correct number of params
  • Loading branch information
hannesj authored Jun 1, 2017
2 parents c4c2145 + e25e026 commit 65e5b2a
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 2 deletions.
6 changes: 4 additions & 2 deletions server/reittiopasParameterMiddleware.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,11 @@ function parseLocation(location, input, config, next) {
locationToOTP({ address: parsedFrom[1], lon: coords[0], lat: coords[1] }),
);
}
return getGeocodingResult(location, {}, null, config).then(parseGeocodingResults).catch(next);
return getGeocodingResult(location, {}, null, null, null, config)
.then(parseGeocodingResults).catch(next);
} else if (input) {
return getGeocodingResult(input, {}, null, config).then(parseGeocodingResults).catch(next);
return getGeocodingResult(input, {}, null, null, null, config)
.then(parseGeocodingResults).catch(next);
}
return ' ';
}
Expand Down
26 changes: 26 additions & 0 deletions test/flow/tests/redirect/search-from-hsl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
module.exports = {
'@tags': ['smoke'],
'@disabled': true, // XXX does not work in travis, figure out why
OldSearchShouldRedirect: (browser) => {
const date = new Date();

const day = date.getDate();
const month = date.getMonth() + 1;
const year = date.getYear() + 1900;
const hour = date.getHours() + -3;
const minute = date.getMinutes();

const url = `${browser.launch_url}&from_in=kamppi&to_in=pasila&when=now&timetype=departure&hour=${hour}&minute=${minute}&daymonthyear=${day}.${month}.${year}&form_build_id=form-wdOvinqH72XqTtDZF0cHQOz8d9o3bU3nrzDbFIv5-Lc&form_id=reittiopas_search_form&day=${day}&month=${month}&year=${year}`;

browser.url(url);
const itinerarySummary = browser.page.itinerarySummary();
itinerarySummary.waitForFirstItineraryRow();
itinerarySummary.chooseFirstItinerarySuggestion();

const itineraryInstructions = browser.page.itineraryInstructions();
itineraryInstructions.waitForFirstItineraryInstructionColumn();
itineraryInstructions.verifyOrigin('Kamppi');
itineraryInstructions.verifyDestination('Pasila');
browser.end();
},
};

0 comments on commit 65e5b2a

Please sign in to comment.