Skip to content

Commit

Permalink
Improve test
Browse files Browse the repository at this point in the history
  • Loading branch information
alfogrillo committed Jul 13, 2023
1 parent 6245f9a commit 2630a82
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -223,10 +223,12 @@ final class NotificationManagerTests: XCTestCase {
func test_InvitesNotificationsRemoval() async throws {
let notificationPublisher = NotificationCenter.default.publisher(for: .invitesScreenAppeared).first()
let expectation = expectation(description: #function)
let subscription = notificationPublisher
var cancellables: Set<AnyCancellable> = .init()
notificationPublisher
.sink { _ in
expectation.fulfill()
}
.store(in: &cancellables)

NotificationCenter.default.post(name: .invitesScreenAppeared, object: nil)
await fulfillment(of: [expectation])
Expand Down

0 comments on commit 2630a82

Please sign in to comment.