mirror of
https://github.com/RevenueCat/purchases-ios
synced 2026-11-10 22:45:55 +05:45
test(paywalls): gate the nested background landscape test to iOS 16
SwiftUI 3 clamps a background nested under a container that already claimed the safe area to that container's box, so on iOS 15 the screen edges keep showing the root background instead of the nested one. The behavior predates #7310 (the background path no longer reads isTransitioning, so it is not transition specific), only the assertion is new. The page root background, which is what #7310 fixed, does reach the edges on iOS 15 and stays covered there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_013dr46HkT4gcbuQZ8eVUnN3
This commit is contained in:
1 parent
cb34d70fba
commit
e2524b647f
1 file changed
+8
@@ -1380,8 +1380,16 @@ final class WorkflowLandscapeSafeAreaTests: TestCase {
|
||||
/// `BackgroundStyleModifier` is also used by stacks, text and badges, not just the page root. A
|
||||
/// nested background has to reach the edge mid-animation the same way it does at rest, or the
|
||||
/// paywall jumps when the animation starts and stops.
|
||||
///
|
||||
/// iOS 16 and up: SwiftUI 3 clamps a background nested under a container that already claimed
|
||||
/// the safe area to that container's box, so the edges keep showing the root background instead.
|
||||
/// Not specific to transitions, `BackgroundStyleModifier` does not read `isTransitioning`.
|
||||
@MainActor
|
||||
func testComponentBackgroundReachesHorizontalScreenEdgesWhileTransitioning() throws {
|
||||
guard #available(iOS 16.0, *) else {
|
||||
throw XCTSkip("SwiftUI 3 clamps a nested background to its ancestor's safe-area box.")
|
||||
}
|
||||
|
||||
try Self.expectBackgroundAtEdges(
|
||||
of: try Self.renderScreenInLandscape(
|
||||
isTransitioning: true,
|
||||
|
||||
Reference in new issue
Block a user