mirror of
https://gitlab.opencode.de/bwi/bundesmessenger/clients/bundesmessenger-ios.git
synced 2026-04-22 09:32:52 +02:00
Show own location in map views (#7375)
* show own location on static sharing * show own location on live sharing * add tests and changelog * check location authorisation, fix center to current user location button * it moves request to LocationManager in proper service * add static location viewer service
This commit is contained in:
+14
@@ -15,6 +15,7 @@
|
||||
//
|
||||
|
||||
import Combine
|
||||
import CoreLocation
|
||||
import XCTest
|
||||
|
||||
@testable import RiotSwiftUI
|
||||
@@ -30,4 +31,17 @@ class LiveLocationSharingViewerViewModelTests: XCTestCase {
|
||||
viewModel = LiveLocationSharingViewerViewModel(mapStyleURL: BuildSettings.defaultTileServerMapStyleURL, service: service)
|
||||
context = viewModel.context
|
||||
}
|
||||
|
||||
func testIsUserBeingShared() {
|
||||
XCTAssertTrue(context.viewState.isCurrentUserShared)
|
||||
}
|
||||
|
||||
func testToggleShowUserLocation() {
|
||||
let service = MockLiveLocationSharingViewerService(currentUserSharingLocation: false)
|
||||
let viewModel = LiveLocationSharingViewerViewModel(mapStyleURL: BuildSettings.defaultTileServerMapStyleURL, service: service)
|
||||
XCTAssertFalse(viewModel.context.viewState.isCurrentUserShared)
|
||||
XCTAssertFalse(viewModel.context.viewState.showsUserLocation)
|
||||
viewModel.context.send(viewAction: .showUserLocation)
|
||||
XCTAssertTrue(viewModel.context.viewState.showsUserLocation)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user