Skip to content

Add executing tests for platformIOSHapticFeedback (L5 iOS) #423

Description

@schatt

Summary

View.platformIOSHapticFeedback and IOSHapticStyle in Framework/Sources/Platform/iOS/Views/Extensions/PlatformIOSOptimizationsLayer5.swift have no executing tests. Spawned from #402: the orphan L5 suite was removed; its haptic tests only called an empty verifyViewCreation and never ran.

Current production

iOS: modifier applies .onChange(of: trigger) and fires UIImpactFeedbackGenerator (.light / .medium / .heavy) or UINotificationFeedbackGenerator (.success / .warning / .error).

Non-iOS: stub func platformIOSHapticFeedback(style: Any = "light", onTrigger: Bool = true) -> some View { self }.

IOSHapticStyle is #if os(iOS) only (not CaseIterable).

Desired tests

Add tests in executing SixLayerFrameworkUnitTests (iOS Simulator unit lane). Strict TDD (strict-tdd-definition): invert new observations, runtime red, then green. No .serialized. Cheapest truthful layer (testing-layer-priority):

  1. Unit: IOSHapticStyle cases are distinct (all six).
  2. View subject type: expectViewSubjectTypeContains (or equivalent) that the iOS modifier actually wraps the root (invert dummy name, lock from got:). Do not lock AnyView.
  3. Non-iOS stub (macOS unit): applying the stub still yields a view whose subject type contains the original root (Text, etc.) — identity, not a crash.

Do not assert that a Taptic Engine fired (not observable in unit tests). Do not reintroduce LayeredTestingSuite.

Related (not this issue unless you expand scope)

Same file, also untested in executing targets: platformIOSNavigationBar, platformIOSToolbar, platformIOSSwipeGestures, platformIOSAccessibility, platformIOSAnimation, platformIOSLayout, platformIOSPullToRefresh, platformIOSContextMenu. Split those if they grow.

References

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions