Skip to content

Commit

Permalink
fixing tests
Browse files Browse the repository at this point in the history
  • Loading branch information
hactar committed May 14, 2024
1 parent bc75a5a commit 6653538
Show file tree
Hide file tree
Showing 8 changed files with 41 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,14 @@ final class MapViewCoordinatorCameraTests: XCTestCase {
animated: .value(false))
.called(count: 1)

// Due to the .frame == .zero workaround, min/max pitch setting is called twice, once to set the
// pitch, and then once to set the actual range.
verify(maplibreMapView)
.minimumPitch(newValue: .value(0))
.setterCalled(count: 2)

verify(maplibreMapView)
.maximumPitch(newValue: .value(0))
.setterCalled(count: 1)

verify(maplibreMapView)
Expand Down Expand Up @@ -70,10 +76,16 @@ final class MapViewCoordinatorCameraTests: XCTestCase {
animated: .value(false))
.called(count: 1)

// Due to the .frame == .zero workaround, min/max pitch setting is called twice, once to set the
// pitch, and then once to set the actual range.
verify(maplibreMapView)
.minimumPitch(newValue: .value(0))
.setterCalled(count: 2)

verify(maplibreMapView)
.maximumPitch(newValue: .value(0))
.setterCalled(count: 1)

verify(maplibreMapView)
.maximumPitch(newValue: .value(60))
.setterCalled(count: 1)
Expand All @@ -99,10 +111,16 @@ final class MapViewCoordinatorCameraTests: XCTestCase {
animated: .any)
.called(count: 0)

// Due to the .frame == .zero workaround, min/max pitch setting is called twice, once to set the
// pitch, and then once to set the actual range.
verify(maplibreMapView)
.minimumPitch(newValue: .value(0))
.setterCalled(count: 2)

verify(maplibreMapView)
.maximumPitch(newValue: .value(0))
.setterCalled(count: 1)

verify(maplibreMapView)
.maximumPitch(newValue: .value(60))
.setterCalled(count: 1)
Expand All @@ -128,10 +146,16 @@ final class MapViewCoordinatorCameraTests: XCTestCase {
animated: .any)
.called(count: 0)

// Due to the .frame == .zero workaround, min/max pitch setting is called twice, once to set the
// pitch, and then once to set the actual range.
verify(maplibreMapView)
.minimumPitch(newValue: .value(0))
.setterCalled(count: 2)

verify(maplibreMapView)
.maximumPitch(newValue: .value(0))
.setterCalled(count: 1)

verify(maplibreMapView)
.maximumPitch(newValue: .value(60))
.setterCalled(count: 1)
Expand All @@ -157,10 +181,16 @@ final class MapViewCoordinatorCameraTests: XCTestCase {
animated: .any)
.called(count: 0)

// Due to the .frame == .zero workaround, min/max pitch setting is called twice, once to set the
// pitch, and then once to set the actual range.
verify(maplibreMapView)
.minimumPitch(newValue: .value(0))
.setterCalled(count: 2)

verify(maplibreMapView)
.maximumPitch(newValue: .value(0))
.setterCalled(count: 1)

verify(maplibreMapView)
.maximumPitch(newValue: .value(60))
.setterCalled(count: 1)
Expand Down
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CameraState.trackingUserLocation(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitch.free, 12.0))
CameraState.trackingUserLocation(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitchRange.free, 12.0))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CameraState.trackingUserLocationWithCourse(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitch.free))
CameraState.trackingUserLocationWithCourse(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitchRange.free))
Original file line number Diff line number Diff line change
@@ -1 +1 @@
CameraState.trackingUserLocationWithHeading(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitch.free))
CameraState.trackingUserLocationWithHeading(zoom: (4.0, 0.0, MapLibreSwiftUI.CameraPitchRange.free))
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
- longitude: 23.4
- zoom: 5.0
- pitch: 12.0
- pitchRange: CameraPitch.free
- pitchRange: CameraPitchRange.free
- direction: 23.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
▿ trackingUserLocationWithCourse: (3 elements)
- zoom: 18.0
- pitch: 0.0
▿ pitchRange: CameraPitch
▿ pitchRange: CameraPitchRange
▿ freeWithinRange: (2 elements)
- minimum: 12.0
- maximum: 34.0
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@
▿ trackingUserLocationWithHeading: (3 elements)
- zoom: 10.0
- pitch: 0.0
- pitchRange: CameraPitch.free
- pitchRange: CameraPitchRange.free
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
▿ trackingUserLocation: (4 elements)
- zoom: 10.0
- pitch: 0.0
▿ pitchRange: CameraPitch
▿ pitchRange: CameraPitchRange
▿ freeWithinRange: (2 elements)
- minimum: 12.0
- maximum: 34.0
Expand Down

0 comments on commit 6653538

Please sign in to comment.