Merge branch 'develop' into maximee/6029_lls_timeline_cell and apply comments

This commit is contained in:
MaximeE
2022-04-25 15:53:58 +02:00
57 changed files with 1680 additions and 155 deletions
@@ -78,7 +78,17 @@ class StaticLocationViewingViewModel: StaticLocationViewingViewModelType, Static
}
let alertInfo = mapViewErrorAlertInfoBuilder.build(with: error) { [weak self] in
self?.completion?(.close)
switch error {
case .invalidLocationAuthorization:
if let applicationSettingsURL = URL(string:UIApplication.openSettingsURLString) {
UIApplication.shared.open(applicationSettingsURL)
} else {
self?.completion?(.close)
}
default:
self?.completion?(.close)
}
}
state.bindings.alertInfo = alertInfo
@@ -19,21 +19,28 @@ import RiotSwiftUI
@available(iOS 14.0, *)
class StaticLocationViewingUITests: MockScreenTest {
private var app: XCUIApplication!
override func setUp() {
continueAfterFailure = false
app = XCUIApplication()
app.launch()
override class var screenType: MockScreenState.Type {
return MockStaticLocationViewingScreenState.self
}
override class func createTest() -> MockScreenTest {
return StaticLocationViewingUITests(selector: #selector(verifyStaticLocationViewingScreen))
}
func verifyStaticLocationViewingScreen() {
guard let screenState = screenState as? MockStaticLocationViewingScreenState else { fatalError("no screen") }
switch screenState {
case .showUserLocation:
verifyInitialExistingLocation()
case .showPinLocation:
verifyInitialExistingLocation()
}
}
func testInitialExistingLocation() {
goToScreenWithIdentifier(MockStaticLocationViewingScreenState.showUserLocation.title)
XCTAssertTrue(app.buttons["Cancel"].exists)
XCTAssertTrue(app.buttons["StaticLocationView.shareButton"].exists)
XCTAssertTrue(app.otherElements["Map"].exists)
func verifyInitialExistingLocation() {
XCTAssertTrue(app.buttons["Cancel"].exists, "The cancel button should exist.")
XCTAssertTrue(app.buttons["shareButton"].exists, "The share button should exist.")
}
}
@@ -61,9 +61,9 @@ struct StaticLocationView: View {
viewModel.send(viewAction: .share)
} label: {
Image(uiImage: Asset.Images.locationShareIcon.image)
.accessibilityIdentifier("LocationSharingView.shareButton")
}
.disabled(!viewModel.viewState.shareButtonEnabled)
.accessibilityIdentifier("shareButton")
}
}
.navigationBarTitleDisplayMode(.inline)