-
Notifications
You must be signed in to change notification settings - Fork 97
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add "searchMode" option for Feature Layer Provider #251
Conversation
… search. Related to Esri#244. Updated debug to test. Feel free to remove for production.
1) 'contain'; default, uses wildcard search 2) 'startWith'; uses wildcard after text 3) 'strict'; must match exactly Remove testing code in debug.html for testing new feature
…Maps/esri-leaflet-geocoder into pmacMaps-feature-layer-query-options
…Maps/esri-leaflet-geocoder into pmacMaps-feature-layer-query-options
Thanks for all your work on this @pmacMaps. Really appreciate it. I tested out the functionality and it seems to work as expected. Added functionality like this calls for unit tests, so we should tack on some unit tests to this PR. I understand that you've done a lot of work on this already, so if you'd like to add those, we would appreciate it but if not, I'll try to find some time to add them. |
I can take a stab at the unit tests. I've never made any before, so any links or guidance is appreciated. I know we'll also need to update the API reference. |
@pmacMaps I believe the additional unit tests will go in https://github.com/Esri/esri-leaflet-geocoder/blob/master/spec/Providers/FeatureLayerSpec.js - right now it has a we are using karma and mocha, but you'll mostly want to focus on the mocha documentation. |
The unit tests may get written faster if someone with experience tackles the issue. I can definitely update the API reference once this functionality ships. |
@pmacMaps good on you for jumping in to make this contribution!
no pressure, but i can say from personal experience that i was initially extremely intimidated by the idea of writing unit tests and that the intimidation gave way to immense gratification when i finally stuck my toe in the water. if you're interested, you can learn heaps by making tiny changes to existing tests one at a time to get practical experience breaking and fixing them. to this day, when i write new tests i still usually rely heavily on existing tests in the suite and just follow the patterns when writing new tests without worrying about understanding exactly how they work. for you the existing test below would be a great one to copy/paste and alter slightly: esri-leaflet-geocoder/spec/Controls/GeosearchSpec.js Lines 112 to 131 in 223c4e9
you'd just need to ensure your own test instantiated a provider using the new option you added and make sure it tests for the corresponding |
Possible values for "searchMode":