This is the function which searches for entered text in the table. I need to write test case for the below function. Please guide.
const getSearchQuery = (searchText, COLUMNS) => {
let query = "";
Object.keys(COLUMNS).map((key) => {
const colName = COLUMNS[key].searchKey;
if(colName !== ""){
return query += `&${formSearchQuery("event."+COLUMNS[key].colKey, Operations.LIKE,"'%25"+searchText+"%25'")}`;
}
});
return query;
};