summaryrefslogtreecommitdiff
path: root/test/style
diff options
context:
space:
mode:
authorBruno de Oliveira Abinader <bruno@mapbox.com>2018-10-02 16:19:15 -0700
committerBruno de Oliveira Abinader <bruno@mapbox.com>2018-10-03 10:19:17 -0700
commitf3c8b92286ad82ce39d400023155ab8bfee1b9a5 (patch)
treed24e752e50dba8fd297bcc6181793d597bc678de /test/style
parentb8578cd13e7647c2ae7be4e42e2b5feddac6ab19 (diff)
downloadqtlocation-mapboxgl-f3c8b92286ad82ce39d400023155ab8bfee1b9a5.tar.gz
[core] Read style's transition from parser
Diffstat (limited to 'test/style')
-rw-r--r--test/style/style.test.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/test/style/style.test.cpp b/test/style/style.test.cpp
index f2055c88f8..2371e91107 100644
--- a/test/style/style.test.cpp
+++ b/test/style/style.test.cpp
@@ -43,6 +43,14 @@ TEST(Style, Properties) {
ASSERT_EQ("", style.getName());
ASSERT_EQ(60, *style.getDefaultCamera().pitch);
+ style.loadJSON(R"STYLE({})STYLE");
+ ASSERT_EQ(Milliseconds(300), *style.getTransitionOptions().duration);
+ ASSERT_EQ(optional<Duration> {}, style.getTransitionOptions().delay);
+
+ style.loadJSON(R"STYLE({"transition": { "duration": 500, "delay": 50 }})STYLE");
+ ASSERT_EQ(Milliseconds(500), *style.getTransitionOptions().duration);
+ ASSERT_EQ(Milliseconds(50), *style.getTransitionOptions().delay);
+
style.loadJSON(R"STYLE({"name": 23, "center": {}, "bearing": "north", "zoom": null, "pitch": "wide"})STYLE");
ASSERT_EQ("", style.getName());
ASSERT_EQ(LatLng {}, *style.getDefaultCamera().center);