diff options
Diffstat (limited to 'test/map')
-rw-r--r-- | test/map/map.test.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/test/map/map.test.cpp b/test/map/map.test.cpp index 95d652f2af..98f8402706 100644 --- a/test/map/map.test.cpp +++ b/test/map/map.test.cpp @@ -160,6 +160,21 @@ TEST(Map, Offline) { NetworkStatus::Set(NetworkStatus::Status::Online); } +TEST(Map, SetStyleDefaultCamera) { + MapTest<> test; + test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty.json")); + EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.0); + EXPECT_DOUBLE_EQ(test.map.getPitch(), 0.0); + EXPECT_DOUBLE_EQ(test.map.getBearing(), 0.0); + EXPECT_EQ(test.map.getLatLng(), LatLng {}); + + test.map.getStyle().loadJSON(util::read_file("test/fixtures/api/empty-zoomed.json")); + EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.0); + + test.map.jumpTo(test.map.getStyle().getDefaultCamera()); + EXPECT_DOUBLE_EQ(test.map.getZoom(), 0.5); +} + TEST(Map, SetStyleInvalidJSON) { Log::setObserver(std::make_unique<FixtureLogObserver>()); |