mirror of
https://github.com/element-hq/element-x-ios.git
synced 2025-03-10 13:37:11 +00:00
Require a specific snapshotting device minor OS version when running PreviewTests
This commit is contained in:
parent
65bacfaae3
commit
84a3ffc135
@ -15,7 +15,7 @@ import SwiftUI
|
||||
class PreviewTests: XCTestCase {
|
||||
private let deviceConfig: ViewImageConfig = .iPhoneX
|
||||
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"]
|
||||
|
||||
override func setUp() {
|
||||
@ -1084,11 +1084,9 @@ class PreviewTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
if let requiredOSVersion {
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
}
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion.major, osVersion.minorVersion == requiredOSVersion.minor else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -25,7 +25,7 @@ import {{ import }}
|
||||
class PreviewTests: XCTestCase {
|
||||
private let deviceConfig: ViewImageConfig = .iPhoneX
|
||||
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"]
|
||||
|
||||
|
||||
@ -163,11 +163,9 @@ class PreviewTests: XCTestCase {
|
||||
}
|
||||
}
|
||||
|
||||
if let requiredOSVersion {
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
}
|
||||
let osVersion = ProcessInfo().operatingSystemVersion
|
||||
guard osVersion.majorVersion == requiredOSVersion.major, osVersion.minorVersion == requiredOSVersion.minor else {
|
||||
fatalError("Switch to iOS \(requiredOSVersion) for these tests.")
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user