This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var app: XCUIApplication! | |
var succulent: Succulent! | |
// The URL to the trace file for the current test when running tests | |
private var traceUrl: URL? { | |
let bundle = Bundle(for: type(of: self)) | |
return bundle.url(forResource: self.traceName, withExtension: "trace", subdirectory: "Succulent") | |
} | |
// The URL to the trace file for the current test when recording |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let baseUrlString = ProcessInfo.processInfo.environment["succulentBaseUrl"] ?? "{YOUR-REAL-BASE-URL}" | |
let baseUrl = URL(string: baseUrlString) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
verify(view).expandTimeBubble(withSearchModeText: "Arrive: ", | |
andDateText: "Wed, 00:00", | |
animated: true) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
view = MockPlannerMapView() | |
stub(view) { stub in | |
when(stub.setPolygons(with: any())).thenDoNothing() | |
when(stub.changeHintViewToOrigin()).thenDoNothing() | |
when(stub.makeTimeBubbleVisible()).thenDoNothing() | |
when(stub.makeTimeBubbleInvisible()).thenDoNothing() | |
when(stub.expandTimeBubble(withSearchModeText: anyString(), | |
andDateText: anyString(), | |
animated: any(Bool.self))) | |
.thenDoNothing() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
describe("route to result card header component view model mapper test") { | |
context("when the route is a walking route") { | |
let route = Route.mockWalkingRoute | |
let departureDate = (route.segments?.first?.stops?.first?.scheduledDate)! | |
context("when the route is in less than 15 minutes") { | |
let currentDate = calendar.date(byAdding: .minute, value: -14, to: departureDate)! | |
let model = mapper.resultCardHeaderComponentViewModel(for: route, currentDate: currentDate) | |
it("returns a route type string for walking") { | |
expect(model.routeType).to(equal("Walk")) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
if let previousCircle = previousCircle { | |
let circleLocation = CLLocation(latitude: circleCoordinate.latitude, | |
longitude: circleCoordinate.longitude) | |
let previousCircleLocation = CLLocation(latitude: previousCircle.position.latitude, | |
longitude: previousCircle.position.longitude) | |
if mapView.projection.points(forMeters: circleLocation.distance(from: previousCircleLocation), | |
at: mapView.camera.target) < intervalDistanceIncrement { | |
continue | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
for coordinateIndex in 0 ..< path.count() - 1 { | |
let startCoordinate = path.coordinate(at: coordinateIndex) | |
let endCoordinate = path.coordinate(at: coordinateIndex + 1) | |
let startLocation = CLLocation(latitude: startCoordinate.latitude, longitude: startCoordinate.longitude) | |
let endLocation = CLLocation(latitude: endCoordinate.latitude, longitude: endCoordinate.longitude) | |
let pathDistance = endLocation.distance(from: startLocation) | |
let intervalLatIncrement = (endLocation.coordinate.latitude - startLocation.coordinate.latitude) / pathDistance | |
let intervalLngIncrement = (endLocation.coordinate.longitude - startLocation.coordinate.longitude) / pathDistance | |
for intervalDistance in 0 ..< Int(pathDistance) { | |
let intervalLat = startLocation.coordinate.latitude + (intervalLatIncrement * Double(intervalDistance)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private let polyline = GMSPolyline(path: GMSPath(fromEncodedPath: "{dq_IowzpAzkAbhF")) | |
override func viewDidLoad() { | |
super.viewDidLoad() | |
mapView.delegate = self | |
set(polyline: polyline, on: mapView) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func mapView(_ mapView: GMSMapView, didChange position: GMSCameraPosition) { | |
set(polyline: polyline, on: mapView) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
guard let path = polyline.path else { | |
return | |
} | |
mapView.clear() | |
let intervalDistanceIncrement: CGFloat = 10 | |
let circleRadiusScale = 1 / mapView.projection.points(forMeters: 1, at: mapView.camera.target) | |
var previousCircle: GMSCircle? | |
for coordinateIndex in 0 ..< path.count() - 1 { | |
let startCoordinate = path.coordinate(at: coordinateIndex) | |
let endCoordinate = path.coordinate(at: coordinateIndex + 1) |
NewerOlder