Skip to content
Snippets Groups Projects
Commit a69b7fd3 authored by Reinder Kraaij's avatar Reinder Kraaij :eye:
Browse files

Add Exterl URls Calls

parent ba792b45
No related branches found
No related tags found
1 merge request!1225Resolve TMSS-2294 "Part iv"
const ExternalUrlsUtils = {
BaseLofarMonitorUrl : "https://proxy.lofar.eu/lofmonitor/station_overview?station=",
/**
* Function to give back a scheduling constraint url
* @param {string} Station - The Station
* @param {string} schedulingUnit - the Unit we are looking at
* @param {string} onDate - 2023-02-14 formatedf formated of the date
* @returns string with the url
*/
getUserRolePermissionForStationAndSchedulingUnitOnDate(station,schedulingUnit,onDate) {
return "/api/scheduling_unit_blueprint/" + schedulingUnit + "/scheduling_constraints_plot/" + station + "/" + onDate
},
/**
* Function to give back the Lofar Monitoring Url
* @param {string} Station - The Station
* @returns string with the url
*/
getLofarMontitorUrlForStation(station) {
return this.BaseLofarMonitorUrl + station
}
};
export default ExternalUrlsUtils;
\ No newline at end of file
import externalUrls from "./externalurls";
describe('getLofarMontitorUrlForStation', () => {
it('should return the correct url', () => {
const subbandString = externalUrls.getLofarMontitorUrlForStation("CS002")
expect(subbandString).toEqual("https://proxy.lofar.eu/lofmonitor/station_overview?station=CS002")
})
});
describe('getUserRolePermissionForStationAndSchedulingUnitOnDate', () => {
it('should return the correct url', () => {
const subbandString = externalUrls.getUserRolePermissionForStationAndSchedulingUnitOnDate("CS003", 21, "1976-08-06")
expect(subbandString).toEqual("/api/scheduling_unit_blueprint/21/scheduling_constraints_plot/CS003/1976-08-06")
})
});
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment