mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-04 01:20:12 +00:00
Require a specific snapshotting device minor OS version when running PreviewTests
This commit is contained in:
committed by
Stefan Ceriu
parent
65bacfaae3
commit
84a3ffc135
@@ -15,7 +15,7 @@ import SwiftUI
|
|||||||
class PreviewTests: XCTestCase {
|
class PreviewTests: XCTestCase {
|
||||||
private let deviceConfig: ViewImageConfig = .iPhoneX
|
private let deviceConfig: ViewImageConfig = .iPhoneX
|
||||||
private var simulatorDevice: String? = "iPhone14,6" // iPhone SE 3rd Generation
|
private var simulatorDevice: String? = "iPhone14,6" // iPhone SE 3rd Generation
|
||||||
private var requiredOSVersion: Int? = 17
|
private var requiredOSVersion = (major: 17, minor: 5)
|
||||||
private let snapshotDevices = ["iPhone 15", "iPad"]
|
private let snapshotDevices = ["iPhone 15", "iPad"]
|
||||||
|
|
||||||
override func setUp() {
|
override func setUp() {
|
||||||
@@ -1084,11 +1084,9 @@ class PreviewTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let requiredOSVersion {
|
let osVersion = ProcessInfo().operatingSystemVersion
|
||||||
let osVersion = ProcessInfo().operatingSystemVersion
|
guard osVersion.majorVersion == requiredOSVersion.major, osVersion.minorVersion == requiredOSVersion.minor else {
|
||||||
guard osVersion.majorVersion == requiredOSVersion else {
|
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ import {{ import }}
|
|||||||
class PreviewTests: XCTestCase {
|
class PreviewTests: XCTestCase {
|
||||||
private let deviceConfig: ViewImageConfig = .iPhoneX
|
private let deviceConfig: ViewImageConfig = .iPhoneX
|
||||||
private var simulatorDevice: String? = "iPhone14,6" // iPhone SE 3rd Generation
|
private var simulatorDevice: String? = "iPhone14,6" // iPhone SE 3rd Generation
|
||||||
private var requiredOSVersion: Int? = 17
|
private var requiredOSVersion = (major: 17, minor: 5)
|
||||||
private let snapshotDevices = ["iPhone 15", "iPad"]
|
private let snapshotDevices = ["iPhone 15", "iPad"]
|
||||||
|
|
||||||
|
|
||||||
@@ -163,11 +163,9 @@ class PreviewTests: XCTestCase {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if let requiredOSVersion {
|
let osVersion = ProcessInfo().operatingSystemVersion
|
||||||
let osVersion = ProcessInfo().operatingSystemVersion
|
guard osVersion.majorVersion == requiredOSVersion.major, osVersion.minorVersion == requiredOSVersion.minor else {
|
||||||
guard osVersion.majorVersion == requiredOSVersion else {
|
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user