Add tests for onSearchFail and onSubmit