Skip to content

Commit c3f89b0

Browse files
committed
Fix OS and device agnostic tests
1 parent 28edca9 commit c3f89b0

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

MapboxNavigationTests/InstructionsBannerViewSnapshotTests.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -257,7 +257,7 @@ class InstructionsBannerViewSnapshotTests: FBSnapshotTestCase {
257257
}
258258

259259
func testExitShields() {
260-
let window = UIApplication.shared.delegate!.window!!
260+
let window = UIWindow(frame: CGRect(origin: .zero, size: .iPhone6Plus))
261261
let view = instructionsView()
262262
styleInstructionsView(view)
263263
view.maneuverView.isStart = true
@@ -279,7 +279,7 @@ class InstructionsBannerViewSnapshotTests: FBSnapshotTestCase {
279279
}
280280

281281
func testGenericShields() {
282-
let window = UIApplication.shared.delegate!.window!!
282+
let window = UIWindow(frame: CGRect(origin: .zero, size: .iPhone6Plus))
283283
let view = instructionsView()
284284
styleInstructionsView(view)
285285
view.maneuverView.isStart = true

MapboxNavigationTests/ManeuverViewTests.swift

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,22 +27,22 @@ class ManeuverViewTests: FBSnapshotTestCase {
2727

2828
func testStraightRoundabout() {
2929
maneuverView.visualInstruction = maneuverInstruction(.takeRoundabout, .straightAhead, .right)
30-
FBSnapshotVerifyLayer(maneuverView.layer)
30+
verify(maneuverView.layer)
3131
}
3232

3333
func testTurnRight() {
3434
maneuverView.visualInstruction = maneuverInstruction(.turn, .right, .right)
35-
FBSnapshotVerifyLayer(maneuverView.layer)
35+
verify(maneuverView.layer)
3636
}
3737

3838
func testTurnSlightRight() {
3939
maneuverView.visualInstruction = maneuverInstruction(.turn, .slightRight, .right)
40-
FBSnapshotVerifyLayer(maneuverView.layer)
40+
verify(maneuverView.layer)
4141
}
4242

4343
func testMergeRight() {
4444
maneuverView.visualInstruction = maneuverInstruction(.merge, .right, .right)
45-
FBSnapshotVerifyLayer(maneuverView.layer)
45+
verify(maneuverView.layer)
4646
}
4747

4848
func testRoundabout() {
@@ -58,7 +58,7 @@ class ManeuverViewTests: FBSnapshotTestCase {
5858
views.addSubview(view)
5959
}
6060

61-
FBSnapshotVerifyLayer(views.layer, suffixes: ["_64"])
61+
verify(views.layer)
6262
}
6363

6464
// TODO: Figure out why the flip transformation do not render in a snapshot so we can test left turns and left side rule of the road.

0 commit comments

Comments
 (0)