-
Notifications
You must be signed in to change notification settings - Fork 32
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
Test that .getLat() and .getLon() change after map.setView() #5
Comments
@jywarren On it |
@jywarren What's blurredLocation? Is it an instance of BlurredLocation? If it is shouldn't it be named object? Little confused. |
Hi, yes, it is - and actually, I think it's best to name the instance this way -- it's a convention you'll see in other libraries. I'll leave a comment to this effect on #3 too. |
@jywarren For this will I have to add an event listener that whenever setView is called any instance of class BlurredLocation will change it values to the same?? |
@jywarren If you can give a green flag I will start working on it. Thanks |
Ah, sorry - yes, that sounds right -- but maybe there's a more general event than OR, maybe more efficient is that since getLon/getLat are methods, you can just look up the current Leaflet map center when they're called, rather than doing it all the time? |
The map won't work till there is a map container tag div with id "map". Do I need to create it using javascript only? for tests atleast? |
You should be able to use a minimal test html template - see how they're
created in PublicLab.Editor... they're stored in a folder inside the spec
folder.
…On May 21, 2017 12:34 AM, "Mridul Nagpal" ***@***.***> wrote:
The map won't work till there is a map container tag div with id "map". Do
I need to create it using javascript only? for tests atleast?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#5 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AABfJ1XPgNqfYiZ2aoCKJCeEHHJok1k6ks5r777pgaJpZM4Nbd-d>
.
|
I used the fixture template and it works well, thanks. Moreover I added the build button and the tests you have mentioned above. Please have a look #3 |
I think this issue is done, what say @jywarren ? |
Great! |
Less return statements + code less redundant
Let's add a test that ensures that the methods
.getLat()
and.getLon()
change after the Leaflet map is interacted with. We can simulate this in tests withmap.setView([lat, lon], zoom)
:Later, we should ensure that it returns that value, but truncated to the current precision/zoom level, so:
In general, testing could use a lot of Leaflet features: http://leafletjs.com/examples/quick-start/
(this can be broken out into a separate issue)
The text was updated successfully, but these errors were encountered: