So I am familiar with testing SwiftUI views, but how do I test the views used for the widget when they don't exist within the app after the app launches(As they are only being used within the widget)?
Additionally, what is the proper way to widget functions themselves (getTimeline etc.)?
I am still very new to iOS programming and want to understand the fundamentals of testing different iOS features. Any guidance would be much appreciated.
My basic project setup:
- Data Models (Successfully Unit Tested)
- Observable Object View Model that has API call functions (Successfully Unit Tested)
- Default ContentView that is navigated to after tapping on the widget (No tests needed since the focus is on the widget)
- WidgetView with the ObservedObject view model (No UI tests written)
- Widget that uses the WidgetView (No UI/Unit tests written)