iPhone: glow and glass fixtures and snapshots
-CallsFixtureSpeaking silent|low|mid|high and -CallsFixtureNoGlass YES, and CallsPhoneUITests.testGlowAndGlassSnapshots rendering the names at four levels and the bar over black, white and busy frames in both.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2 files changed,
+37
−2
native/ios/Sources/PhoneCallFixture.swift+8 −2native/ios/UITests/CallsPhoneUITests.swift+29 −0
diff --git a/native/ios/Sources/PhoneCallFixture.swift b/native/ios/Sources/PhoneCallFixture.swift| index b38a236..05bef8a 100644 |
| --- a/native/ios/Sources/PhoneCallFixture.swift |
| +++ b/native/ios/Sources/PhoneCallFixture.swift |
| @@ -8,8 +8,11 @@ |
| /// optionally `-CallsFixtureControls shown|hidden` to pin the controls, |
| /// `-CallsFixtureMore YES` to open the controls menu, `-CallsFixtureDark |
| /// YES`, `-CallsFixtureClassic YES`, `-CallsFixtureBackdrop black|white|busy` |
| - /// for a frame in place of the stage, and `-CallsFixtureSelf |
| - /// muted|cameraOff|sharing` for your own state. |
| + /// for a frame in place of the stage, `-CallsFixtureSelf |
| + /// muted|cameraOff|sharing` for your own state, `-CallsFixtureSpeaking |
| + /// silent|low|mid|high` for everyone's speaking glow, and |
| + /// `-CallsFixtureNoGlass YES` for the material older systems draw in |
| + /// place of Liquid Glass. |
| struct PhoneCallFixture: View { |
| static var requested: CallFixture? { |
| UserDefaults.standard.string(forKey: "CallsCallFixture").flatMap(CallFixture.init(rawValue:)) |
| @@ -33,6 +36,7 @@ |
| .environment( |
| \.fixtureBackdrop, |
| defaults.string(forKey: "CallsFixtureBackdrop").flatMap(FixtureBackdrop.init(rawValue:))) |
| + .environment(\.callOverlayGlass, !defaults.bool(forKey: "CallsFixtureNoGlass")) |
| .preferredColorScheme(defaults.bool(forKey: "CallsFixtureDark") ? .dark : .light) |
| .onAppear { |
| guard !applied else { return } |
| @@ -40,6 +44,8 @@ |
| fixture.apply(to: call) |
| UserDefaults.standard.string(forKey: "CallsFixtureSelf") |
| .flatMap(FixtureSelf.init(rawValue:))?.apply(to: call) |
| + UserDefaults.standard.string(forKey: "CallsFixtureSpeaking") |
| + .flatMap(FixtureSpeaking.init(rawValue:))?.apply(to: call) |
| } |
| } |
| } |
diff --git a/native/ios/UITests/CallsPhoneUITests.swift b/native/ios/UITests/CallsPhoneUITests.swift| index 07b7ce2..e100302 100644 |
| --- a/native/ios/UITests/CallsPhoneUITests.swift |
| +++ b/native/ios/UITests/CallsPhoneUITests.swift |
| @@ -272,6 +272,35 @@ final class CallsPhoneUITests: XCTestCase { |
| } |
| } |
| + /// 0.3.7: the names glowing at four levels, in the grid and in focus, |
| + /// and the glass over black, white and a busy frame, in Liquid Glass and |
| + /// in the material older systems draw instead. |
| + @MainActor func testGlowAndGlassSnapshots() throws { |
| + XCUIDevice.shared.orientation = .portrait |
| + for level in ["silent", "low", "mid", "high"] { |
| + for fixture in ["grid", "focus"] { |
| + let app = launchCall( |
| + fixture, ["-CallsFixtureControls", "shown", "-CallsFixtureSpeaking", level], dark: true) |
| + XCTAssertTrue(app.buttons["leave"].waitForExistence(timeout: 15)) |
| + Thread.sleep(forTimeInterval: 1) |
| + try snapshot(app, "glow-\(fixture)-\(level)") |
| + } |
| + } |
| + for glass in [true, false] { |
| + for backdrop in ["black", "white", "busy"] { |
| + let app = launchCall( |
| + "notices", |
| + [ |
| + "-CallsFixtureControls", "shown", "-CallsFixtureBackdrop", backdrop, |
| + "-CallsMicBesideMenu", "YES", "-CallsFixtureNoGlass", glass ? "NO" : "YES", |
| + ], dark: true) |
| + XCTAssertTrue(app.buttons["leave"].waitForExistence(timeout: 15)) |
| + Thread.sleep(forTimeInterval: 1) |
| + try snapshot(app, "bar-\(glass ? "glass" : "fallback")-\(backdrop)") |
| + } |
| + } |
| + } |
| + |
| /// Landscape keeps both bar buttons on screen, clear of the Dynamic |
| /// Island's side. |
| @MainActor func testLandscapeKeepsTheBarOnScreen() throws { |