Shapshot Testing - leboncoin/spark-ios GitHub Wiki
Snapshot Testing
Most of the views are tested using snapshot testing.
The snapshots are stored in each components repositories.
UIKit Components
For snapshot testing UIKit components, there is a helper class UIKitComponentTestCase
which generates snapshots for a variety of sizes and light and dark mode. The test class should extend UIKitComponentTestCase
and use the function assertSnapshotInDarkAndLight
for asserting the tests.
SwiftUI Components
For snapshot testing SwiftUI components, there is a helper class SwiftUIComponentTestCase
which generates snapshots for a variety of sizes and light and dark mode. The test class should extend SwiftUIComponentTestCase
and use the function assertSnapshotInDarkAndLight
for asserting the tests.