Prefire icon indicating copy to clipboard operation
Prefire copied to clipboard

Update `#Preview` macro generated test to use `snapshotDevices`.

Open markst opened this issue 1 year ago • 4 comments

Short description 📝

When using #Preview macro to generate snapshot tests in combination with test configuration with multiple snapshot_devices:

test_configuration:
  - target: ShowPage
  - simulator_device: "iPhone15,4"
  - required_os: 17
  - snapshot_devices:
      - iPhone 15
      - iPad
  - imports:
      - UIKit
      - Foundation

The appropriate snapshot function is not called.

Resolution

Updates the PreviewLoader extension to ensure compatibility with a template-generated function that loops through different devices for snapshot testing.

markst avatar Sep 03 '24 03:09 markst