-
Notifications
You must be signed in to change notification settings - Fork 12
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 runtime-styling tests for 'smart setStyle' #170
Conversation
Ready for 👀 @jfirebaugh @lucaswoj The first commit is just the bulk copy of each |
Looks good! Can you also add tests for:
|
👍 ack--yeah, good call. |
This one might be a weird -- I think what this will entail is putting a set of font data that is different from |
Oh, actually -- maybe it would be simpler (and less contrived?) to add |
Would a hack like |
@jfirebaugh It would probably work as far as testing that setStyle doesn't blow up, but my concern is that, since this URL would be pointing to the same font files, the expected output after the setStyle operation would be identical to what's shown before it -- so the test would not be able to distinguish between |
You should be able to change the url from |
Ohh, nice--that would be simpler. |
|
Update:
|
Ugh, weirdness. The Not a big deal if CircleCI is still happy, except that this probably means that the |
K, dealt with the above by just removing the icons. They aren't relevant to this test anyway. |
"id": "fill", | ||
"type": "fill", | ||
"source": "vector", | ||
"source-layer": "building" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"id": "circle", | ||
"type": "circle", | ||
"source": "geojson" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: the original circle
layer uses an sdf icon colored red.
{ | ||
"id": "circle", | ||
"type": "circle", | ||
"source": "geojson" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: the original circle
layer points at wrong-geojson
, whose coordinates are off-center.
0 | ||
] | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: in the original style, the point is off-center.
"id": "circle", | ||
"type": "circle", | ||
"source": "geojson" | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: in the original style, the smaller, red circle (circle-2
) comes after the black one, so that it appears in the center.
(Note -- in this commit, this test is wrong because the source also changes; fixed in e7e13da.)
"symbol-placement": "point", | ||
"icon-allow-overlap": true, | ||
"icon-ignore-placement": true, | ||
"icon-image": "restaurant-12" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: the original style uses generic_icon
from the emerald
sprite set.
"text-field": "{name}", | ||
"text-font": [ | ||
"NotoCJK" | ||
], |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reason that expected.png
looks right: the original style uses text-field: 'HELLO'
, rendered with Open Sans / Arial.
In response to a sudden bout of paranoia--and also hopefully to make the review a little easier--I added code comments in each of the new tests indicating why the expected.png makes sense. (A couple of them are 'outdated' because I was going commit-by-commit.) I think this should now be ready for review. |
@mollymerp didn't want to lose track of your Slack question re: reusing expected images for
So, there are lots of duplicated images, but I figured that, eventually, the non-set-style versions of the tests will just be removed entirely... so maybe the dupe-ing is okay, temporarily? |
For each existing runtime-styling test, adds a corresponding test using
setStyle