swift-snapshot-testing
swift-snapshot-testing copied to clipboard
RTL is not reversing direction when i pass UIView
usually i control RTL and LTR using .environment(\.layoutDirection, .leftToRight)
but for UIViews i need to make the view LTR then take snapshot then make it RTL and take another snapshot at the same test
however it feels impossible, i tried
UIView.appearance().semanticContentAttribute = .forceRightToLeft
and tried also recursively apply semanticContentAttribute
to all it's subviews but it what only make it work is test plan config for Application Language, i need another way to successfully do it same as SwiftUI views .environment(\.layoutDirection, .leftToRight)
i am using:
verifySnapshot(
matching: uiview,
as: .image(precision: precision, subpixelThreshold: 5),
named: testName,
record: recording,
snapshotDirectory: snapshotDirectory,
timeout: timeout,
file: file,
testName: testName
)
Please advise