Add unit tests around search functions
Add unit tests around search functions

* Refactored tests around the search function
* Included more scenarios around the search
function
* Added tests for uncovered functions

uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-fe-beta2,uktrade/data-hub-frontend,uktrade/data-hub-frontend