Skip to content

Add SwiftUI hosting smoke tests for field-level Observation - #22

Open
thliu21 wants to merge 1 commit into
sonmbol:mainfrom
thliu21:agent/kmpobservablebridge-18
Open

Add SwiftUI hosting smoke tests for field-level Observation#22
thliu21 wants to merge 1 commit into
sonmbol:mainfrom
thliu21:agent/kmpobservablebridge-18

Conversation

@thliu21

@thliu21 thliu21 commented Jul 31, 2026

Copy link
Copy Markdown

Summary

  • add Apple-platform SwiftUI hosting smoke tests for two independent projected fields
  • verify a field B emission does not reevaluate the field A-only subtree on Observation-capable systems
  • verify global invalidation and the ObservableObject fallback both invalidate the expected hosted subtrees
  • make view identity, shared observation setup, and teardown cancellation explicit
  • document supported Xcode versions and simulator destinations

Fixes #18

Harness

Each projected field is rendered by a separate SwiftUI View identity. The
runtime path uses KMPObservedObject, while a test-only configuration forces
the same production store through its ObservableObject fallback.

The source emits dependency notifications synchronously. Tests wait for
positive body-render and cancellation signals; timeouts are failure bounds
only. The field-isolation assertion is made after the B subtree has rendered,
without an inverted expectation or sleep.

The suite also includes a runtime-gated iOS 15/16 fallback test. A forced
fallback test keeps that contract covered on current runtimes when an older
simulator is unavailable.

Validation

  • SwiftUI hosting suite: 3 passed, 1 expected runtime skip, 0 failures
  • repeated hosting run: 3 passed, 1 expected runtime skip, 0 failures
  • complete strict-concurrency compilation
  • API compatibility: no breaking changes in all three products
  • package manifest consistency
  • whitespace validation

The repository-wide -warnings-as-errors command currently stops on three
pre-existing Swift 6.3 WeakMutability diagnostics in
KMPObservableBridgeTests.swift; the new hosting test file compiles without
diagnostics.

Verified locally with Xcode 26.5 on macOS 26.5.2. An iOS 15/16 runtime was not
installed locally, so that runtime-specific case remains explicitly
unverified rather than being reported as passed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add SwiftUI hosting smoke tests for field-level Observation

1 participant