Swift @Published properties come with an associated Combine Publisher that emits values over time. This free XCTest tutorial explains when to write a unit test that accesses the property directly and when it's instead necessary to subscribe to it using the sink operator.
Snippets to test the behavior of Combine Publishers in XCTest ready to copy and paste into Xcode