mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-03 16:10:20 +00:00
Update files following swiftformat upgrade
This commit is contained in:
committed by
Stefan Ceriu
parent
fe189fcfed
commit
23062901c0
@@ -7,11 +7,10 @@
|
||||
//
|
||||
|
||||
import Combine
|
||||
import SwiftUI
|
||||
import XCTest
|
||||
|
||||
@testable import ElementX
|
||||
@testable import SnapshotTesting
|
||||
import SwiftUI
|
||||
import XCTest
|
||||
|
||||
@MainActor
|
||||
class PreviewTests: XCTestCase {
|
||||
@@ -23,8 +22,8 @@ class PreviewTests: XCTestCase {
|
||||
private let deviceConfig: ViewImageConfig = .iPhoneX
|
||||
private let simulatorDevice: String? = "iPhone14,6" // iPhone SE 3rd Generation
|
||||
private let requiredOSVersion = (major: 26, minor: 1)
|
||||
// The key is the name we will give to the snapshot
|
||||
// The value is the actual device that will be used to render the preview
|
||||
/// The key is the name we will give to the snapshot
|
||||
/// The value is the actual device that will be used to render the preview
|
||||
private let snapshotDevices: [SnapshotDevice] = [.init(name: "iPhone", device: "iPhone 17"),
|
||||
.init(name: "iPad", device: "iPad")]
|
||||
private var recordMode: SnapshotTestingConfiguration.Record = .missing
|
||||
@@ -142,8 +141,7 @@ class PreviewTests: XCTestCase {
|
||||
preferences: SnapshotPreferences) -> String? {
|
||||
let matchingView = isScreen ? AnyView(view) : AnyView(view
|
||||
.frame(width: device.size?.width)
|
||||
.fixedSize(horizontal: false, vertical: true)
|
||||
)
|
||||
.fixedSize(horizontal: false, vertical: true))
|
||||
|
||||
return withSnapshotTesting(record: recordMode) {
|
||||
verifySnapshot(of: matchingView,
|
||||
@@ -255,5 +253,7 @@ private extension Diffing where Value == UIImage {
|
||||
private extension UIEdgeInsets {
|
||||
/// A custom inset that prevents the snapshotting library from rendering the
|
||||
/// origin at (10000, 10000) which breaks some of our views such as MessageText.
|
||||
static var one: UIEdgeInsets { UIEdgeInsets(top: 1, left: 1, bottom: 1, right: 1) }
|
||||
static var one: UIEdgeInsets {
|
||||
UIEdgeInsets(top: 1, left: 1, bottom: 1, right: 1)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user