diff --git a/Backpack-SwiftUI/Tests/Text/BPKTextDynamicTypeTests.swift b/Backpack-SwiftUI/Tests/Text/BPKTextDynamicTypeTests.swift index e3652f48e..1eb61cb82 100644 --- a/Backpack-SwiftUI/Tests/Text/BPKTextDynamicTypeTests.swift +++ b/Backpack-SwiftUI/Tests/Text/BPKTextDynamicTypeTests.swift @@ -22,30 +22,14 @@ import SnapshotTesting @testable import Backpack_SwiftUI class BPKTextDynamicTypeTests: XCTestCase { - private let categories: [(UIContentSizeCategory, String)] = [ - (.extraSmall, "xs"), - (.large, "l"), - (.accessibilityMedium, "a11y_m"), - (.accessibilityExtraExtraExtraLarge, "a11y_3xl") - ] - func test_dynamicType() { let sut = generateView([ - (.hero1, "Hero 1"), (.heading1, "Heading 1"), (.bodyDefault, "Body default"), (.caption, "Caption"), (.footnote, "Footnote") - ]).frame(width: 700, height: 500) - - let view: UIView = UIHostingController(rootView: sut).view - - categories.forEach { category in - assertSnapshot( - matching: view, - as: .image(size: view.intrinsicContentSize, traits: .init(preferredContentSizeCategory: category.0)), - named: "dynamic_type_\(category.1)") - } + ]) + assertA11ySnapshot(sut) } private func generateView(_ styles: [(BPKFontStyle, String)]) -> some View { @@ -53,7 +37,6 @@ class BPKTextDynamicTypeTests: XCTestCase { ForEach(styles, id: \.self.1) { style in BPKText(style.1, style: style.0) } - Spacer() } } } diff --git a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.a11y.png b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.a11y.png new file mode 100644 index 000000000..4c0fd3d6c Binary files /dev/null and b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.a11y.png differ diff --git a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_3xl.png b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_3xl.png deleted file mode 100644 index 902a376f6..000000000 Binary files a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_3xl.png and /dev/null differ diff --git a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_m.png b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_m.png deleted file mode 100644 index 2921efa57..000000000 Binary files a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_a11y_m.png and /dev/null differ diff --git a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_l.png b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_l.png deleted file mode 100644 index 1decf6e99..000000000 Binary files a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_l.png and /dev/null differ diff --git a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_xs.png b/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_xs.png deleted file mode 100644 index 023c51a4a..000000000 Binary files a/Backpack-SwiftUI/Tests/Text/__Snapshots__/BPKTextDynamicTypeTests/test_dynamicType.dynamic_type_xs.png and /dev/null differ