Skip to content
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(TileLayer): make sure zoomOffset option is used #6011

Merged
merged 1 commit into from
Jan 19, 2018

Conversation

ghybs
Copy link
Collaborator

@ghybs ghybs commented Jan 18, 2018

This PR adds 2 dedicated tests to make sure that the Tile Layer's zoomOffset option is correctly taken into account when building the tiles URL.
As mentioned in #6010 (comment)

Follows issue #6004 (fixed by PR #6006).

The tests fail when PR #5822 is active, and pass correctly after PR #6006 is applied.

Unfortunately I could not add a similar test for detectRetina option that easily, because since the move to Rollup build, Browser values became internal variables, and overriding them later on does not have any effect on Leaflet internal references…
Not sure how to workaround this for the sake of testing.

following issue Leaflet#6004 (fixed by PR Leaflet#6006).
Added 2 dedicated tests.
Unfortunately I could not add a test for detectRetina option that easily, because since the move to Rollup, Browser values became internal variables, and overriding them later on does not have any effect on Leaflet internal references… Not sure how to workaround this for the sake of testing.
Copy link
Collaborator

@cherniavskii cherniavskii left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

It's not easy to tweak L.Browser.retina :/
I found one solution, but it will set L.Browser.retina to true for all tests. They pass, but I'm still not sure it's the way to go. @ghybs what do you think about this?

@ghybs
Copy link
Collaborator Author

ghybs commented Jan 18, 2018

Hum personally I would not like forcing that flag for all tests.

Maybe make a 2-pass process?
Depending on what command Travis uses to run CI tests, that may be do-able.

IIRC, you started modifying the test configuration to be able to test on many browsers.
Could that fit in as well?
Since Retina is linked to hardware, it might not be easy to test different configurations on the same machine.

Maybe we could also give a try to Sauce Labs (https://saucelabs.com/open-source free for Open Source projects)

@cherniavskii
Copy link
Collaborator

@ghybs yes, I tried to add testing in Chrome(#5845) and Firefox(#5831) to CI, but there are some failing tests which need to be fixed first :/ Anyway, those PRs will not help to test retina.

Looks like Sauce Labs is the best solution here (I think they provide testing on mobile platforms as well).
But most probably we'll have to fix some failing tests there too.
That being said, I think it's worth to give it a try!

@ghybs ghybs merged commit 86099a8 into Leaflet:master Jan 19, 2018
@ghybs ghybs deleted the testTileLayerZoomOffset branch January 19, 2018 02:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants