Update files following swiftformat upgrade

This commit is contained in:
Stefan Ceriu
2026-01-27 08:47:03 +02:00
committed by Stefan Ceriu
parent fe189fcfed
commit 23062901c0
343 changed files with 1502 additions and 1048 deletions
@@ -6,9 +6,8 @@
// Please see LICENSE files in the repository root for full details.
//
import Foundation
@testable import Compound
import Foundation
import SwiftUI
import XCTest
@@ -17,7 +16,7 @@ final class DecorativeColorsTests: XCTestCase {
let input: String
private let webOutput: Int
// remember that web starts the index from 1 while we start from 0
/// remember that web starts the index from 1 while we start from 0
var output: Int {
webOutput - 1
}
@@ -12,7 +12,7 @@ import XCTest
final class FontSizeTests: XCTestCase {
/// Test all system text styles to assert mapping between `Font` and `UIFont`.
func testTextStyle() throws {
func testTextStyle() {
let caption2FontSize = FontSize.reflecting(.caption2)
XCTAssertEqual(caption2FontSize?.value, 11)
XCTAssertEqual(caption2FontSize?.style, .caption2)
@@ -6,9 +6,8 @@
// Please see LICENSE files in the repository root for full details.
//
import Foundation
@testable import Compound
import Foundation
import XCTest
@MainActor
@@ -7,11 +7,10 @@
//
import Combine
import SwiftUI
import XCTest
@testable import Compound
@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
@@ -130,8 +129,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,
@@ -243,5 +241,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)
}
}