Fix navigationStackCoordinator getting torn down when being reset on … (#613)

* Fix navigationStackCoordinator getting torn down when being reset on the navigationSplitCoordinator, added unit tests for it

* Guard against using the same coordinator more than once
This commit is contained in:
Stefan Ceriu
2023-02-23 16:01:48 +02:00
committed by GitHub
parent 99d6caed4e
commit ad06e812bc
4 changed files with 39 additions and 3 deletions
@@ -259,9 +259,13 @@ class NavigationSplitCoordinatorTests: XCTestCase {
// MARK: - Private
private func assertCoordinatorsEqual(_ lhs: CoordinatorProtocol?, _ rhs: CoordinatorProtocol?) {
if lhs == nil, rhs == nil {
return
}
guard let lhs = lhs as? SomeTestCoordinator,
let rhs = rhs as? SomeTestCoordinator else {
XCTFail("Coordinators are not the same")
XCTFail("Coordinators are not the same: \(String(describing: lhs)) != \(String(describing: rhs))")
return
}