mirror of
https://github.com/Novaloop-AG/element-x-ios.git
synced 2026-11-02 21:33:26 +00:00
Move Map Libre API key to Xcode Cloud (#1313)
* Add config_production lane * Add maplibre to .gitignore * Add setupMapLibreKey * Add documentation * Fix failing UTs * Fix more UTs * Cleanup * Add secrets.xcconfig * Cleanup gitignore file * Update post-checkout hook * Cleanup SetupProject * Update project * Remove leftover in SetupProject * Cleanup project.yml * Add fastlane-plugin-xcconfig * Improve test * Update docs
This commit is contained in:
@@ -88,10 +88,9 @@ class HomeScreenViewModelTests: XCTestCase {
|
||||
let room: RoomProxyMock = .init(with: .init(id: mockRoomId, displayName: "Some room"))
|
||||
room.leaveRoomClosure = { .failure(.failedLeavingRoom) }
|
||||
clientProxy.roomForIdentifierMocks[mockRoomId] = room
|
||||
let deferred = deferFulfillment(context.$viewState.first(), message: "viewState should be published.")
|
||||
context.send(viewAction: .confirmLeaveRoom(roomIdentifier: mockRoomId))
|
||||
try await deferred.fulfill()
|
||||
XCTAssertNotNil(context.alertInfo)
|
||||
let state = await context.nextViewState()
|
||||
XCTAssertNotNil(state?.bindings.alertInfo)
|
||||
}
|
||||
|
||||
func testLeaveRoomSuccess() async throws {
|
||||
|
||||
@@ -179,27 +179,59 @@ final class NotificationManagerTests: XCTestCase {
|
||||
}
|
||||
|
||||
func test_MessageNotificationsRemoval() async throws {
|
||||
let notificationPublisher = NotificationCenter.default.publisher(for: .roomMarkedAsRead).first()
|
||||
var cancellables: Set<AnyCancellable> = .init()
|
||||
let expectation1 = expectation(description: #function)
|
||||
notificationPublisher
|
||||
.sink { _ in
|
||||
expectation1.fulfill()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
// No interaction if the object is nil or of the wrong type
|
||||
NotificationCenter.default.post(name: .roomMarkedAsRead, object: nil)
|
||||
try await Task.sleep(for: .microseconds(200))
|
||||
await fulfillment(of: [expectation1])
|
||||
XCTAssertEqual(notificationCenter.deliveredNotificationsCallsCount, 0)
|
||||
XCTAssertEqual(notificationCenter.removeDeliveredNotificationsCallsCount, 0)
|
||||
|
||||
|
||||
let expectation2 = expectation(description: #function)
|
||||
notificationPublisher
|
||||
.sink { _ in
|
||||
expectation2.fulfill()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
NotificationCenter.default.post(name: .roomMarkedAsRead, object: 1)
|
||||
try await Task.sleep(for: .microseconds(200))
|
||||
await fulfillment(of: [expectation2])
|
||||
XCTAssertEqual(notificationCenter.deliveredNotificationsCallsCount, 0)
|
||||
XCTAssertEqual(notificationCenter.removeDeliveredNotificationsCallsCount, 0)
|
||||
|
||||
|
||||
let expectation3 = expectation(description: #function)
|
||||
notificationPublisher
|
||||
.sink { _ in
|
||||
expectation3.fulfill()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
// The center calls the delivered and the removal functions when an id is passed
|
||||
NotificationCenter.default.post(name: .roomMarkedAsRead, object: "RoomID")
|
||||
try await Task.sleep(for: .microseconds(200))
|
||||
await fulfillment(of: [expectation3])
|
||||
XCTAssertEqual(notificationCenter.deliveredNotificationsCallsCount, 1)
|
||||
XCTAssertEqual(notificationCenter.removeDeliveredNotificationsCallsCount, 1)
|
||||
}
|
||||
|
||||
func test_InvitesNotificationsRemoval() async throws {
|
||||
let notificationPublisher = NotificationCenter.default.publisher(for: .invitesScreenAppeared).first()
|
||||
let expectation = expectation(description: #function)
|
||||
var cancellables: Set<AnyCancellable> = .init()
|
||||
notificationPublisher
|
||||
.sink { _ in
|
||||
expectation.fulfill()
|
||||
}
|
||||
.store(in: &cancellables)
|
||||
|
||||
NotificationCenter.default.post(name: .invitesScreenAppeared, object: nil)
|
||||
try await Task.sleep(for: .microseconds(200))
|
||||
await fulfillment(of: [expectation])
|
||||
XCTAssertEqual(notificationCenter.deliveredNotificationsCallsCount, 1)
|
||||
XCTAssertEqual(notificationCenter.removeDeliveredNotificationsCallsCount, 1)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user